D
Dave
Hello all. I've been unable to build a string to suit my purpose. Here are
the details. I have created a combo box, in the header of a form that is
unbound. The purpose is to be able to search for an address when you don't
know all of it, maybe just the street... the query behind the combo looks up
the street and the recordid and holds the recordid for later use. The combo
box should allow the user to type in the partial street information and find
the records that match so the customer can then select the appropriate record.
example of address: 123 anywhere street or 123 anywhere way, 123 mystreet
etc.. The customer migth only know "anywhere" as the street so they would
enter that in the combo box and the combo box would then limit the records
for selection to any address containing "anywhere" Here's the code I've been
working with. I also know this combo box code is placed in the after update
event. I just can't get the portion of the code to accept the "like "*" "
portion. In a query I would say: "like "*" & [Enter as much of the street as
you know] & "*" [addressm] is the field we're searching. Help is
appreciated. Thanks
Set crit1 = "*"
Set crit2 = "like"
criteria = "[addressm] = '" & crit2 & Me.cboquicksearch & crit2 & "'"
Set myrs = Me.RecordsetClone
myrs.FindFirst criteria
If Not myrs.NoMatch = True Then
Me.Bookmark = myrs.Bookmark
end if
the details. I have created a combo box, in the header of a form that is
unbound. The purpose is to be able to search for an address when you don't
know all of it, maybe just the street... the query behind the combo looks up
the street and the recordid and holds the recordid for later use. The combo
box should allow the user to type in the partial street information and find
the records that match so the customer can then select the appropriate record.
example of address: 123 anywhere street or 123 anywhere way, 123 mystreet
etc.. The customer migth only know "anywhere" as the street so they would
enter that in the combo box and the combo box would then limit the records
for selection to any address containing "anywhere" Here's the code I've been
working with. I also know this combo box code is placed in the after update
event. I just can't get the portion of the code to accept the "like "*" "
portion. In a query I would say: "like "*" & [Enter as much of the street as
you know] & "*" [addressm] is the field we're searching. Help is
appreciated. Thanks
Set crit1 = "*"
Set crit2 = "like"
criteria = "[addressm] = '" & crit2 & Me.cboquicksearch & crit2 & "'"
Set myrs = Me.RecordsetClone
myrs.FindFirst criteria
If Not myrs.NoMatch = True Then
Me.Bookmark = myrs.Bookmark
end if