Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden form variable, not declared

Status
Not open for further replies.

akirekab

Programmer
Aug 17, 2002
7
US
In a select case item several form names are used. The name in some cases is like a variable, writte, Form_frmSomeName, and according to the only comment I found in vba book, is used when addressing an otherwise hidden form.

Here is layout:

myFormName = GetDivisionFormNameByID(Form_frmJobCost.DivisionID)

Me.frmOrders.SourceObject = myFormName

Select Case myFormName
Case "frmOrdersOne"
Form_frmOrdersOne.Filter = "OrderID=" & Me.lblWOid.Caption
Form_frmOrdersOne.FilterOn = True
Form_frmOrdersOne.Requery

Case "frmOrdersTwo"
Form_frmOrdersTwo.Filter = "OrderID=" & Me.lblWOid.Caption
Form_frmOrdersTwo.FilterOn = True
Form_frmOrdersTwo.Requery

Case "frmOrdersThree"
Form_frmOrdersThree.Filter = "OrderID=" & Me.lblWOid.Caption
Form_frmOrdersThree.FilterOn = True
Form_frmOrdersThree.Requery

Case one and two were working fine, I added case three, thinking that was all I had to do, and it wouldn't compile. Said hadn't been declared. Can anyone shed some light on what it means, and where or how would it be declared. I can find no other trace of the names anywhere.
Thank You
 
Hi

The line

"Me.frmOrders.SourceObject = myFormName"

suggestes that your form has a sub form control on it called "frmOrders",

that subform control may be used as a container for several sub forms.

what is the code of GetDivisionFormNameByID?

Are you aware you can jump to definition of a variable or function by right clicking on when in code window?



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top