Hello All,
I'm working on a database tracking patients upon hospital discharge. I have a main navigation form with multiple navigation tabs. Each of the navigation sheets has a embedded subform in datasheet view.
The database contains:
patient table including name, date of birth, pt_id (primary key)
discharge table including discharge date, notes, pt_id, discharge_id(primary key)
interventions table including discharge_id, intervention type, intervention_id (primary key)
On the navigation form in the footer I have a combo box (searchcbo) that pulls from the patient table listing (in separate columns) name, date of birth (and pt_id hidden) I would like to use this combo box to filter what is shown on the first navigation page of the navigation form. This first page is titled discharges and with no filter would show query results pulled from the patient and discharge table in a subform titled discharge_qrysubform.
The query contains name, date of birth, date of discharge, notes on discharge. It is shown in datasheet view. When a name is selected in the combo box, i would like the after update function to filter the results based on patient id only to show those discharged for the given patient.
I've tried using the following vba code:
Private Sub searchcbo_AfterUpdate()
discharge_qrysubform.Form.Filter = "[pt_id]= '" & searchcbo & "'"
discharge_qrysubform.Form.FilterOn = True
End Sub
and all i get is a object required 424 error. Any help or suggestions would be greatly appreciated.
Thanks.