Marchello2004
Technical User
Hi
I have an interesting one here... I have a dropdown list which displays staff name. The name selected will be then stored in a table by using a submit button that works as follows...
Dim strSQL As String
strSQL = "INSERT INTO Bookings (staff_name,) Values ('" & cmbStaff_name & "')"
CurrentDb.Execute strSQL
This all works beautifully; the problem here is that some of the names use inverted comas, such as (O'Donovan) and the code gets confused, so it will not submit anything to the table.
I'm guessing I need a function for this but I have no idea where to start. Does anyone have any idea of how to solve this? And changing the database content is not really an option...
Thanks!!
I have an interesting one here... I have a dropdown list which displays staff name. The name selected will be then stored in a table by using a submit button that works as follows...
Dim strSQL As String
strSQL = "INSERT INTO Bookings (staff_name,) Values ('" & cmbStaff_name & "')"
CurrentDb.Execute strSQL
This all works beautifully; the problem here is that some of the names use inverted comas, such as (O'Donovan) and the code gets confused, so it will not submit anything to the table.
I'm guessing I need a function for this but I have no idea where to start. Does anyone have any idea of how to solve this? And changing the database content is not really an option...
Thanks!!