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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form not found.. why? 1

Status
Not open for further replies.

ychousa

MIS
Jun 11, 2003
82
US
I have this problem here and there in my database, so I think something fundamental is wrong.

One example is my list box to show salesmans in [tblDetail Subform] on OnCurrent event.

Here's the code:

ListSalesMan.RowSource = "SELECT DISTINCT SalesMan FROM tblSalesMan WHERE DetID = " & Forms![tblDetail Subform].DetID

The form [tblDetail Subform] do exist in my database, so I really don't know what is wrong.

I have this the same problem in a search function in my db, so this is something fundamental such as reference or something.

Anybody has any ideas?

John
 
Is the form open at the time your code refers to it?

Ken S.
 
Is this a subform - i.e. one that is only open when you open another form (its parent)? If so you need to refer to a subform through its parent e.g. Forms!ParentFormName!SubFormName.Form in order to use field data in the subform.
 
Thanks for your replies for both of you.

Since I'm new to VBA, I occasionally get stumped by its syntax. I think I should have learned the syntax before I started this project, but it's ongoing anyhow.

Anyway, I figured it out and it works!

Thank you.

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top