View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Glen Mettler[_4_] Glen Mettler[_4_] is offline
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