I have a search form (main from) containing a combo box from which a user can select one of two service request types to do seraches on. Each service request type calls its own query to populate a subform with five fields of data captured from the appropriate table.
The queries work fine and bring back the associated records from the tables. But when I add the primary key field to the queries, they return only the first record in the table.
The funny thing is the queries work fine in design view but not in the search form. Any Suggestions to what may be happening?
Here's some of the code I used in the serach event of the form:
The queries work fine and bring back the associated records from the tables. But when I add the primary key field to the queries, they return only the first record in the table.
The funny thing is the queries work fine in design view but not in the search form. Any Suggestions to what may be happening?
Here's some of the code I used in the serach event of the form:
Code:
If Me.cboServReqType.Value = 166 Then
Me.Form.RecordSource = "tbLingSuppServ"
Me.SubformA.Form.RecordSource = "qryLingSuppSearch"
Me.SubformA.Form.txtRequestNum.ControlSource = "LS_RequestNum"
Me.SubformA.Form.txtRequestDate.ControlSource = "LS_RequestDate"
Me.SubformA.Form.txtRequestStatus.ControlSource = "LS_RequestStatus"
Me.SubformA.Form.txtDeptAgency.ControlSource = "LS_DeptAgency"
Me.SubformA.Form.txtContactName.ControlSource = "LS_ContactName"
Me.SubformA.Form.txtContactPhone.ControlSource = "LS_ContactPhone"
Me.SubformA.Form.txtID.ControlSource = "CT_tbCodeTable_ID"
Me.SubformA.Form.txtID.ControlSource = "LS_tbCodeTable_ID"
Me.SubformA.Form.txtTableID.ControlSource = "LS_tbLingServ_ID"
End If