Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Form.Show problem

I have a form entitled WBSpik designed to present a Work Breakdown Structure
code in a popup

WBSpik as a form exists. When I run it from the editor, it works fine.
In my startup code, I get an error message.

Here is the section of code (in the WorksheetChange event)
This section of code is executed whenever the user double clicks on a cell
in the "Performer" column
The concept is: If the user changes the "Performer", then there must be a
change in the WBS - therefore show the WBSpik popup

If sCol = Range("Performer").Value Then
'capture current row
sRow = sRow + 1
'capture WBS column
WBScol = Range("WBSn").Value
'capture value in Performer cell
PerfVal = Cells(sRow, sCol)
'capture value of current WBS
ThisWBS = Cells(sRow, WBScol).Value
'lookup performer WBS based on PerfVal
ThisPerfWBS = Application.WorksheetFunction.VLookup(PerfVal,
Sheets("lists").Range("AF2:AG30"), 2, 0)
'capture first 2 digits of WBS
ThisWBS = Mid(Cells(sRow, WBScol).Value, 1, 2)
'if first 2 digits of ThisWBS do not match ThisPerfWBS - show popup
If Mid(ThisPerfWBS, 1, 2) < ThisWBS Then
'make sure cursor is in proper cell
Cells(sRow, WBScol).Select
'Show WBSpik form
WBSpik.Show
End If
End If

The error occurs at "WBSpik.Show"

Anybody know why?

Thanks,
Glen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Form.Show problem

What is the error message you are getting?
The code before WBSpik.Show doesn't really matter - even if there was a
problem the form should show when you get to this line unless something else
is interfering with it. My first guess is that there is something that runs
when the form opens that is having problems. Do you have a
UserForm_Initialize or _Activate procedure? If so, take a look in there for
a possible error that might be occurring as the form opens. You could put a
breakpoint in the code and then step through it to test this.

I would need to know more to speculate any further - what is the error
message, and what happens when your form loads? What controls are on the
form?
--
- K Dales


"Glen Mettler" wrote:

I have a form entitled WBSpik designed to present a Work Breakdown Structure
code in a popup

WBSpik as a form exists. When I run it from the editor, it works fine.
In my startup code, I get an error message.

Here is the section of code (in the WorksheetChange event)
This section of code is executed whenever the user double clicks on a cell
in the "Performer" column
The concept is: If the user changes the "Performer", then there must be a
change in the WBS - therefore show the WBSpik popup

If sCol = Range("Performer").Value Then
'capture current row
sRow = sRow + 1
'capture WBS column
WBScol = Range("WBSn").Value
'capture value in Performer cell
PerfVal = Cells(sRow, sCol)
'capture value of current WBS
ThisWBS = Cells(sRow, WBScol).Value
'lookup performer WBS based on PerfVal
ThisPerfWBS = Application.WorksheetFunction.VLookup(PerfVal,
Sheets("lists").Range("AF2:AG30"), 2, 0)
'capture first 2 digits of WBS
ThisWBS = Mid(Cells(sRow, WBScol).Value, 1, 2)
'if first 2 digits of ThisWBS do not match ThisPerfWBS - show popup
If Mid(ThisPerfWBS, 1, 2) < ThisWBS Then
'make sure cursor is in proper cell
Cells(sRow, WBScol).Select
'Show WBSpik form
WBSpik.Show
End If
End If

The error occurs at "WBSpik.Show"

Anybody know why?

Thanks,
Glen



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Form.Show problem

You are correct. I disovered an error in the initialize portion of the
form.

Thanks

Glen

"K Dales" wrote in message
...
What is the error message you are getting?
The code before WBSpik.Show doesn't really matter - even if there was a
problem the form should show when you get to this line unless something
else
is interfering with it. My first guess is that there is something that
runs
when the form opens that is having problems. Do you have a
UserForm_Initialize or _Activate procedure? If so, take a look in there
for
a possible error that might be occurring as the form opens. You could put
a
breakpoint in the code and then step through it to test this.

I would need to know more to speculate any further - what is the error
message, and what happens when your form loads? What controls are on the
form?
--
- K Dales


"Glen Mettler" wrote:

I have a form entitled WBSpik designed to present a Work Breakdown
Structure
code in a popup

WBSpik as a form exists. When I run it from the editor, it works fine.
In my startup code, I get an error message.

Here is the section of code (in the WorksheetChange event)
This section of code is executed whenever the user double clicks on a
cell
in the "Performer" column
The concept is: If the user changes the "Performer", then there must be
a
change in the WBS - therefore show the WBSpik popup

If sCol = Range("Performer").Value Then
'capture current row
sRow = sRow + 1
'capture WBS column
WBScol = Range("WBSn").Value
'capture value in Performer cell
PerfVal = Cells(sRow, sCol)
'capture value of current WBS
ThisWBS = Cells(sRow, WBScol).Value
'lookup performer WBS based on PerfVal
ThisPerfWBS = Application.WorksheetFunction.VLookup(PerfVal,
Sheets("lists").Range("AF2:AG30"), 2, 0)
'capture first 2 digits of WBS
ThisWBS = Mid(Cells(sRow, WBScol).Value, 1, 2)
'if first 2 digits of ThisWBS do not match ThisPerfWBS - show popup
If Mid(ThisPerfWBS, 1, 2) < ThisWBS Then
'make sure cursor is in proper cell
Cells(sRow, WBScol).Select
'Show WBSpik form
WBSpik.Show
End If
End If

The error occurs at "WBSpik.Show"

Anybody know why?

Thanks,
Glen





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show time on a form NDBC Excel Discussion (Misc queries) 2 June 30th 09 11:22 AM
Help! Animated gif-image in form does not show animation when form loaded JoCa Excel Programming 4 September 23rd 04 07:43 PM
Show user form PCOR Excel Programming 1 December 31st 03 12:15 AM
Only Show User Form Once cornishbloke[_8_] Excel Programming 4 December 29th 03 01:24 PM
Show' Read Only' On A Form Dave[_18_] Excel Programming 1 July 30th 03 12:29 AM


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"