custom find to search multiple records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Due to data issues I don't have the energy to explain I had to create two
unique identifier fields (old data not consistant)....but I'd like to somehow
allow the user to enter search parameters into only one field and actually
search both.

Is this possible?

thank you!
 
Sure. Without more details. it would be hard to give you an exact answer,
but you can enter the same criteria under two fields in a query. Placing
these on separate rows in the query grid will create an *or* condition and
find any records where the entered criteria is found in either of the
fields.

FIELD1 FIELD2
=[EnterValue]
=[EnterValue]
 
on the AfterUpdate event of your control:

'-----------------------

If IsNull(Me.ActiveControl) Then Exit Function

'save current record if changes were made
If me.dirty then me.dirty = false

Dim mStr As String
mStr = Me.ActiveControl
Me.ActiveControl = Null
Me.RecordsetClone.FindFirst "[field1] & [field2] = '" &
mStr & "'"

If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Function
End If

'-----------------------

I am assuming these are strings...

you can use LIKE instead of = if you want to use wildcards


Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access
strive4peace2006 at yahoo.com
 
Back
Top