Image Database form

G

Guest

I have 19 fields in a table all in regards to information about photo images
In this table 4 of those fields are called ;
1=Keyword
2=2nd Keyword
3=3rd Keyword
4=4th Keyword
I also have a form which contains 4 fields also linked to the four fields in
the table.

The code for the combo box is as follows;

Private Sub Combo109_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[IRN] = '" & Me![Combo109] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

How do i make it search for single / multiple keywords in the 4 keyword
fields.

Part two

When it searches these records instead of returning the required records to
the the front of my form page, it takes the search to that individual record.
For example searching on cattle will take me to record 18 whereas i would
rather record 18 become record one and if multiple records become 1-2-3 of 22
instead of 8-14-22 of 22. Hopefully someone understands this.
 
G

Guest

Hi Silver,

The answer to both parts of your post are the same - instead of doing a
findfirst, set a filter on your form based on the value of the combo eg:

me.filter = "[IRN] = '" & Me![Combo109] & "'"
me.filteron = true

to include your keyword fields, you would do this:

me.filter = "[IRN] = '" & Me![Combo109] & "' OR Keyword1 like '*" '" &
Me![Combo109] & "*'"
me.filteron = true

Hope this helps.

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