Thanks Ofer,
Both the flgFieldNo and the txtFlgField are text that are input by the user.
I am doing it this way because I have 9 flag fields and I don't want to have
to program a button for each flag field.
I tried to update the code but am failing miserably. Still getting the
syntax error in UPDATE Statement message.
Here is my updated code:
Private Sub btn_ClFlag_Click()
On Error GoTo Err_btn_ClFlag_Click
Dim strSQL As String
Dim flgFieldNo As String
Dim txtFlgfield As String
flgFieldNo = InputBox("Enter Flag #:", "Flag Field")
txtFlgfield = InputBox("Enter Flag Criteria to be Cleared. i.e.",
"Clear Flag" & flgFieldNo)
If Me.Dirty Then
Me.Dirty = False
End If
strSQL = "UPDATE Tbl_Contacts SET Tbl_Contacts.Flag'" & flgFieldNo & "
="" WHERE ((Tbl_Contacts.Flag'" & flgFieldNo & "'" & ") = '" & txtFlgfield &
"'" & ");"
DBEngine(0)(0).Execute strSQL, dbFailOnError
Me.Requery
Exit_btn_ClFlag_Click:
Exit Sub
Err_btn_ClFlag_Click:
msgbox Err.Description
Resume Exit_btn_ClFlag_Click
End Sub
Can you please help.

Signature
www.bardpv.com
Tempe, Arizona
> There are few things that I can see
> 1. I can't see which value you are setting the Tbl_Contacts.Flag
[quoted text clipped - 52 lines]
> > Can someone tell me what is wrong with the SQL statement? Maybe quotes in
> > the wrong place?
Ofer Cohen - 28 Jun 2007 20:58 GMT
Try
strSQL = "UPDATE Tbl_Contacts SET Tbl_Contacts.Flag" & flgFieldNo & _
" = '' WHERE ((Tbl_Contacts.Flag" & flgFieldNo & ") = '" & txtFlgfield & "')"
Assuming that you want to update the field with empty value

Signature
Good Luck
BS"D
> Thanks Ofer,
>
[quoted text clipped - 97 lines]
> > > Can someone tell me what is wrong with the SQL statement? Maybe quotes in
> > > the wrong place?
Emma Aumack - 28 Jun 2007 21:20 GMT
YES!!!!! Success!! Thank you! I'm going to save this and study it thoroughly!

Signature
www.bardpv.com
Tempe, Arizona
> Try
>
[quoted text clipped - 104 lines]
> > > > Can someone tell me what is wrong with the SQL statement? Maybe quotes in
> > > > the wrong place?