Hello,
I am new to the forum and am looking for some guidance on how to setup my access 2010 VBA code to handle customer name values with an apostrophe in them.
The function works perfectly for customers without apostrophes.
My function is a combo box search that displays all of the entries that match the selection from the combo box search.
Here is the VBA code:
Private Sub cboCustomerSearch_AfterUpdate()
myCustomer = "Select * from tblCustomerMaster where ([Customer] = '" & Me.cboCustomerSearch & "')"
Me.Form.RecordSource = myCustomer
Me.Form.Requery
End Sub
I think I need to convert the value of [Customer] in my tblCustomerMaster to a string value?
Thanks,
Garrett
I am new to the forum and am looking for some guidance on how to setup my access 2010 VBA code to handle customer name values with an apostrophe in them.
The function works perfectly for customers without apostrophes.
My function is a combo box search that displays all of the entries that match the selection from the combo box search.
Here is the VBA code:
Private Sub cboCustomerSearch_AfterUpdate()
myCustomer = "Select * from tblCustomerMaster where ([Customer] = '" & Me.cboCustomerSearch & "')"
Me.Form.RecordSource = myCustomer
Me.Form.Requery
End Sub
I think I need to convert the value of [Customer] in my tblCustomerMaster to a string value?
Thanks,
Garrett