Combo box with 3 fields used to open new form

  • Thread starter Thread starter bjaneb
  • Start date Start date
B

bjaneb

I have a combo box with 3 fields, serial #, mfg code,date. They are in
a table as example:
121 MP 0606. I can have only one record with that number but I can
have 121 LP 0606 as well. When my user selects 121 LP 0606 from the
combo box, I want to open a fom that shows the details for that record.
Any suggestions?
 
One way:
(assuming that we have to add a space between the three fields in the
combo to make the key for the search)

1) add a txtbox to the form that has visible= false (txtSearch)

2) in the afterupdate event of combi
me.txtSearch = me.comboname.column(0) & " " & me.comboname.column(1) &
" " & me.comboname.column(2)

3) either create a query for the information you need with a criteria
of
forms![nameofformwithcombo]![txtSearch]
or
create a query for the information you need and then

4) also in the afterupdate event
either
docmd.openform "formname"

or
docmd.openform "forname',,, "[querykeyfieldname] = '" &
txtSearch & "'"

if the second approach it is the stringcriteria that you are supplying
and I am not sure how many commas are ruquired to get there.
 
Back
Top