Hi
I'm slowly trying to get into vba but I need help, please.
I'm trying to update the DefaultVetID field in tblDefaultVet to the value of the Combobox in the form frmSelectVet. This is done in the After Update event of the Combobox but the reference to the Combobox is incorrect.
The value needs to be passed on to a text field, DefaultVetID, in the report rptHealthClearance. I currently do this with a DLookup command from the text field in the report called.
I then have a DLookup command in the PracticeName, Address & Telephone fields using the value in the DefaultVetID as the record source to get the values for the specific record.
I've attached my database file. Hope this makes sense.
Thank you in advance
I'm slowly trying to get into vba but I need help, please.
I'm trying to update the DefaultVetID field in tblDefaultVet to the value of the Combobox in the form frmSelectVet. This is done in the After Update event of the Combobox but the reference to the Combobox is incorrect.
The value needs to be passed on to a text field, DefaultVetID, in the report rptHealthClearance. I currently do this with a DLookup command from the text field in the report called.
I then have a DLookup command in the PracticeName, Address & Telephone fields using the value in the DefaultVetID as the record source to get the values for the specific record.
I've attached my database file. Hope this makes sense.
Thank you in advance
Code:
Private Sub CboVet_AfterUpdate()
DoCmd.RunSQL "UPDATE tbldefaultvet SET [Defaultvetid] = cbovet.column(0)"
End Sub