You could also filter form02 (in its record source) by the value in the appropriate textbox on form01, and do a requery of from02 from the AfterUpdate event of that textbox, as well as the Current event of form01. Or you could create a filter string as in boag's example, and apply it to form02, from the textbox's AfterUpdate event. Which method you want to use would depend on several factors, such as: Is form02 always open, or would you just open it after making a song selection? Do you want the song selection to persist, even if form01 is closed? (in that case, you would need to save the ID value to something, either the Tag property of form02 or a global variable, or a custom database property).
Main Topics
Browse All Topics





by: boag2000Posted on 2009-11-18 at 16:36:46ID: 25856592
Can you explain a bit more about the purpose of this system and why you need to specify a query criteria in this manner?
2
Perhaps there is a more efficient method...
Because if this "criteria" is basically a Filter for Form2, then you need not do anything to the query at all.
;-)
Since you did not post any details on the code you are currently using, I will presume that you just need a generic solution.
Something like this on Form2, will filter form2 with a value from a textbox on Form2.
Dim lngSongNo as Long
lngSongNo =YourCriteriaTextBoxOnForm
Me.Filter="SongNo=" & lngSongNo
Me.filterOn=True
;-)
JeffCoachman