I have a database I am making. I have 1 table with data.
I am making a "limit" that will limit records based on a combobox. When I select the table column list it has all the names. When I hit limit it goes through here.
the cmbLocalOffice. Value has a value of "1" instead of the Office name. I am missing something easy here. Does the code need to be the .value since I am getting text and not a number?
I am making a "limit" that will limit records based on a combobox. When I select the table column list it has all the names. When I hit limit it goes through here.
Code:
Private Sub cmbLocalOffice_AfterUpdate()
'Filter frmAll based on search criteria
Forms!frmMain!frmAll.Form.RecordSource = "SELECT tblAirwatch.ID, tblLocalOffice.LocalOffice, tblAirwatch.Region, tblAirwatch.Address, tblAirwatch.City, tblAirwatch.State, tblAirwatch.ZipCode, tblAirwatch.iPadSerialNumber, tblAirwatch.AirwatchName, tblAirwatch.PrinterBluetoothPin FROM tblAirwatch INNER JOIN tblLocalOffice ON tblAirwatch.LocalOfficeID = tblLocalOffice.LocalOfficeID WHERE (((tblLocalOffice.LocalOffice)=[Forms]![frmMain]![frmAll]![LocalOfficeID].value)) ORDER BY tblLocalOffice.LocalOffice;"
Forms!frmMain.Caption = "Search Results"
End Sub


Comment