G
Guest
I'm trying to update a table via a command button on a form. The command
button opens the table and selects the particular record to update through an
SQL statement. I'm getting an error from the WHERE clause of the query due
to the fact that the field the WHERE clause accesses contains a comma. Here
is the code that I have.
..
..
..
If Not IsNull(Me!txtStaffMember) Then
SQLStmt = "SELECT * FROM RBES1 WHERE txtStaffMember = " &
Me!txtStaffMember
rst.Open SQLStmt, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
..
..
..
The error states "Syntax error (comma) in query expression 'txtStaffMember =
xxxxx,x' ". I'm assumming this is from the WHERE clause as the field
txtStaffMember does contain a person's last name and first initial separated
by a comma. . Is there any way around this?
button opens the table and selects the particular record to update through an
SQL statement. I'm getting an error from the WHERE clause of the query due
to the fact that the field the WHERE clause accesses contains a comma. Here
is the code that I have.
..
..
..
If Not IsNull(Me!txtStaffMember) Then
SQLStmt = "SELECT * FROM RBES1 WHERE txtStaffMember = " &
Me!txtStaffMember
rst.Open SQLStmt, CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
..
..
..
The error states "Syntax error (comma) in query expression 'txtStaffMember =
xxxxx,x' ". I'm assumming this is from the WHERE clause as the field
txtStaffMember does contain a person's last name and first initial separated
by a comma. . Is there any way around this?