Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records from a Data Combo Box 1

Status
Not open for further replies.

DreadPirate

Technical User
Sep 3, 2001
8
US
Greetings,

Sorry for such a simple question, but I'm really stuck on this. Any help would be greatly appreciated.

I have a Data Combo Box with cities from an access database in them. I want the user to be able to selct one of the cities, then push a button next to a text box and have that city appear in the box. Easy enough. The tricky part is that I then want to call the entire data row associated with that city. I first tried using ADO for the combo box and DAO for the actual finding (Recordset.FindFirst). I'm not all that good with ADO, so I bet there's an easier way to do it. Anyway, whenever I have DAO find the record, it tells me that the Jet engine does not recognize 'Madrid' as a proper Field or object. This is how I coded it:

txtCity1.Text = dcbCities.Text
Data1.Recordset.FindFirst "City = " & txtWeap1.Text & ""


I've tried it a few other ways, but none have worked. Can anyone tell me what I'm doing wrong? I truly appreciate your time and assistance.

{R}
 
Try:



Data1.Recordset.FindFirst "City = """ & txtWeap1.Text & """"



That might help. Basically I am just making sure that the field value is surrounded by quotes.
 
Jitter, you rock!

It worked perfectly. Thanks for the help.


{R}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top