Searching

S

SueM

Hi,

I have a combobox on a form which successfully will search
for an item based on inputting parameters (in this case a
product name) in a query.

However it doesn't do a second query. I have tried putting
a requery for the combo on a command button on click event
(Me.Combo1.Requery) but it didn't work.

So to clear the combo I used Me.Combo1.Value=Null. This
clears the combo fine but doesn't allow for a second
search/query to be run.

I thought after that, that I needed to try to use a find
method perhaps and tried a control button with the
following command in the onclick event.
DoCmd.FindRecord "banana", , True, , True

This seems to have run as I no longer get yellow
highlighting or red words, but I can't view the results

I tried putting this on a cmobo but it didn't seem to
work.

Any ideas how I can make the search or the requery work?
 
D

Dave Cousineau

i don't know what you mean by a second query
do you mean it works once, but not a second time?
im not sure i understand what your trying to do
you say the combo box is performing a query that loads
data elsewhere

if you do Me.Combo.Requery, you are requerying the list in
the combo box, but thats it you won't trigger a requery
anywhere else

if you say Me.Combo.Value = Null you are simply erasing
the current selection in the Combo Box, but again aren't
going to trigger a requery anywhere else

what part of the form loads the data that the combo box
searches for?

that is the part that you would wan't to be requerying
 
S

SueM

Yep, it works once but not a second time..

The query runs from the row source of the combo box which
holds a query with the following line as a criteria:

Like "*" & [Type the food name to search for:] & "*"

This brings up a prompt in which the user can insert the
name of the product they are looking for.

Any ideas how to get this to requery?

Cheers,

Sue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top