Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I cannot make a query work in Access 2010?

I have a table tblRecords

I have a form frmReports

I have a query qryFindName

The user populates tblRecords by a combo box cmbTechName (and other fields). The query finds all the records with Name = cmbTechName

In the TechName fied of qryFindName I have = [forms]![frmReports].[cmbTechName]

The user hits a button called cmdFindTechName with the code:

Private Sub cmdFindTechName_Click()

DoCmd.OpenQuery "qryFindName", acViewNormal, acEdit

End Sub

It runs the query, but I get no records. I believe the TechName is correct because the same combo box populates the records table and the query. I can't figure out what I'm doing wrong.

Any help?

thanks

1 Answer

Relevance
  • Yoda
    Lv 4
    7 years ago
    Favorite Answer

    It's very likely the result of the combo box is the primary key, or "ID" field and not what the field itself displays. Access can be really bad about alerting you to this or telling you about type mismatches.

    In your "qryFindName," you seem to indicate it's joining on the name rather than the ID. Change it to the ID, which may require a little rework of the query, and see if that does the trick.

Still have questions? Get your answers by asking now.