G
Gina Whipp
All,
Below is a the standard code I use in a combo box.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[llListingID] = " & str(Nz(Me![cboTerritoryName], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.Form.AllowAdditions = False
The query used to find the data is...
SELECT qryLister.llListingID, qryLister.llTerritoryName
FROM qryLister
WHERE (((qryLister.llTerritoryName) Like "*"+[Enter any part of Territory
Name:]+"*"));
All works fine for the first look-up. But in order to refresh the combo box
so it allows one to 'reuse' the Like criteria I am trying to put a Refresh
or ReQuery. I have tried the On_Exit (which I used before and it worked but
not in Access 2003), the On_GotFocus and the On_Click event. What I get is
you type in say "we", get your selection but before it actually goes to the
matching record it puts up the Like critieria again. What I want is once
you make your selection, go to that selection and then when you go to look
up another selection it asks for the Like criteria. If I leave out the
Refresh or ReQuery I have to close the menu and start again.
Hope that makes sense. Any ideas?
Below is a the standard code I use in a combo box.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[llListingID] = " & str(Nz(Me![cboTerritoryName], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.Form.AllowAdditions = False
The query used to find the data is...
SELECT qryLister.llListingID, qryLister.llTerritoryName
FROM qryLister
WHERE (((qryLister.llTerritoryName) Like "*"+[Enter any part of Territory
Name:]+"*"));
All works fine for the first look-up. But in order to refresh the combo box
so it allows one to 'reuse' the Like criteria I am trying to put a Refresh
or ReQuery. I have tried the On_Exit (which I used before and it worked but
not in Access 2003), the On_GotFocus and the On_Click event. What I get is
you type in say "we", get your selection but before it actually goes to the
matching record it puts up the Like critieria again. What I want is once
you make your selection, go to that selection and then when you go to look
up another selection it asks for the Like criteria. If I leave out the
Refresh or ReQuery I have to close the menu and start again.
Hope that makes sense. Any ideas?