Continuous Form using search function

S

Silver76

Having a combo box in the form header, i wish to search for single / multiple
keywords on four fields in a subform returning the required records with the
particular keyword(s).

I have four keyword fields in my image form table which is linked to a
keywords table.

How do i go about making the combobox in my form header allow me to search
the four fields with a either a single search term or a multiple number of
search words returning the number of records related to those keyterms
 
D

Damian S

Hi Silver...

Use the AfterUpdate event of your combo box to set a filter on your subform.
Remember to test for null for your combo boxes!!

eg:

if isnull(me.COMBO1) then
me.SUBFORMNAME.form.filter = ""
me.SUBFORMNAME.form.filteron = false
else
me.SUBFORMNAME.form.filter = "FIELDNAME = " & me.COMBO1
me.SUBFORMNAME.form.filteron = true
endif

Hope this helps.

Damian.
 
S

Silver76

Cheers Damian

How do i set up a filter?

Also where would i place the code

If IsNull(Me.COMBO1) Then
Me.SUBFORMNAME.Form.Filter = ""
Me.SUBFORMNAME.Form.FilterOn = False
Else
Me.SUBFORMNAME.Form.Filter = "FIELDNAME = " & Me.COMBO1
Me.SUBFORMNAME.Form.FilterOn = True
End If

on the actual combo's visual basic form

Cheers

Sorry but this is the first database that i have created
 
D

Damian S

Hi again,

You would put the code sample (with the proper field names etc) behind the
after update event of your combo box... try getting a single combo box
working first.

Damian.
 

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