subform that will not pull its info

Zako

Registered User.
Local time
Today, 03:59
Joined
Apr 20, 2003
Messages
18
Ok, I have a strange problem with subforms...

Table = tblWork
Main Form = frmNewSearch
Subform = sbfrmNewSearch
Subform Object in Main Form = sbfrmNewSearch

In frmNewSearch I have 3 text boxes and a command button.
The command button has some VB code attached to it that creates a query called "Dynamic_Query" and searches the tblWork based on the criteria entered into the 3 text boxes. The command button/query works perfectly and pulls the correct data.

The problem is, the subform (sbfrmNewSearch) wont pull the data when accessed from the Main form (frmNewSearch)

However, if I directly open the subform (sbfrmNewSearch) it does pull the data from the query as it should.

I have tried adding a command button to cause the subform to requery, but it does not do anything.

Any suggestions on what I might be doing wrong with this thing?

thanks.
 
Is the main form a bound to the table? And do you have child and master fields setup correctly?
 
the main form is bound to the table.

I currently have no child/master relationship setup but originally I had it setup by the ID field (the primary key for the table) which is in the Table and the Query.

It didnt work eithe way.
 
Ok. You say the main form has three textboxes for entering criteria. So really the main form is there just to set criteria and nothing else. Well then what you need to do is set the main form to an unbound form.

The easiest thing to do is then set the subform to a parameter query that references the textboxes on the main form. Then have your button requery the subform.
 

Users who are viewing this thread

Back
Top Bottom