Sub form data not refreshing (1 Viewer)

Tupacmoche

Registered User.
Local time
Today, 15:08
Joined
Apr 28, 2008
Messages
291
I have a search button on my main form labeled 'search' it opens a dialoge box that has two unbound
text boxes and a 'run search' button. After entering the two criteria and pressing 'run search' vba
code runs a DoCmd.OpenForm called 'search Results'. This form is a container for a subform that
displays the columns that meet the criteria that were entered. The problem is if, I change what I
entered into the the two unbound text boxes and click on 'Run Search' again the information in the
subform does not refreash. I have added me.refreash, me.requery to the subform but it does not work.

The data source for the subform is a query with this where clause:
WHERE (((dbo_tblTransmittalInfo.GiftID) Like "*" & [Forms]![FrmSearch]![TxtTransmittalNo] & "*") AND
((dbo_tblTransmittalInfo.DonorName) Like "*" & [Forms]![FrmSearch]![TxtDonorName] & "*"));

It only works the first time, I enter text into the unbound text boxes and open the form after that
nothing. Can anyone see what, I'm missing?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:08
Joined
Aug 30, 2003
Messages
36,124
The requery would have to happen in the button code, not in the subform itself.

Me.SubformName.Form.Requery
 

Tupacmoche

Registered User.
Local time
Today, 15:08
Joined
Apr 28, 2008
Messages
291
The requery would have to happen in the button code, not in the subform itself.

Me.SubformName.Form.Requery
Thanks that put me on the right path. This worked:
Forms("Search Results").qrySearchTransmittal_subform.Form.Requery
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:08
Joined
Aug 30, 2003
Messages
36,124
Glad you got it working.
 

Users who are viewing this thread

Top Bottom