Selecting by Name or Number

  • Thread starter Thread starter DP
  • Start date Start date
D

DP

Is there a way to select an item based on knowing either
the Number or Name. (I'm using Combo boxes). Example would
be to eventually find "1160 Broadway" by entering either
1160 or Broadway.

I suppose one combined query of Numbers and Names might
work for the first combo where the second combo is limited
to the results of the first selection. It seems like a
complication to build that query, is there an easier way?
 
Of course, you could parse the field, extract its numeric portion and alpha
portion, but I think the easiest way is to simply match a substring:

"SELECT * FROM tblMyTable WHERE [Address] LIKE *""" & Me!cboMyCombo & "*"""

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top