Textbox Search

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

Guest

I have a textbox on a form. I would like to enter the key for the related
table and pull up the information for that record. If however that key does
not exist I can then enter a new record using that number as the key. Thank
you for your assistance.
 
I can do the "exact" match without any problem. How about if I will use
LIKE???

Ex: in text box(forms!myquery!queryname) if I key in "and", it will search
for all *and*??? (any string which content "and") Should I have the filter
in query or when the query result (the form or report) is open???

Thanks.

Ofer said:
Look at this link on creating a search form

http://www.databasedev.co.uk/text_search.html

If the Id is not found, you can add the code to move to a new record, and
assign the key value to the Real key field in the form

DoCmd.GoToRecord , , acNewRec
Me.[Real key value field name] = Me.[Search key field value name]
--
\\// Live Long and Prosper \\//
BS"D


T Horner said:
I have a textbox on a form. I would like to enter the key for the related
table and pull up the information for that record. If however that key does
not exist I can then enter a new record using that number as the key. Thank
you for your assistance.
 
Soloved.

In Macro's openform, where condition
I use [ID] like "*"& [Forms]!{myquery]![queryname] & "*"

Vivi said:
I can do the "exact" match without any problem. How about if I will use
LIKE???

Ex: in text box(forms!myquery!queryname) if I key in "and", it will search
for all *and*??? (any string which content "and") Should I have the filter
in query or when the query result (the form or report) is open???

Thanks.

Ofer said:
Look at this link on creating a search form

http://www.databasedev.co.uk/text_search.html

If the Id is not found, you can add the code to move to a new record, and
assign the key value to the Real key field in the form

DoCmd.GoToRecord , , acNewRec
Me.[Real key value field name] = Me.[Search key field value name]
--
\\// Live Long and Prosper \\//
BS"D


T Horner said:
I have a textbox on a form. I would like to enter the key for the related
table and pull up the information for that record. If however that key does
not exist I can then enter a new record using that number as the key. Thank
you for your assistance.
 
Back
Top