We have a Contacts & Events database made up of three tables viz
tblContacts, tblEvents and tblAttendance with the latter linking
contacts to particular events.
The tblContacts table has a Yes/No field called 'Select".
When we want to view the Contacts for a particular event, we do so in
a continuous form driven by a query.
What we want to do is have a button that will update all the 'Select'
boxes to Yes within this event only. I've tried the following but it
doesn't work. Can someone tell me what's wrong?
Private Sub Command97_Click ()
Dim strSQL As String
Debug.Print strSQL
Set dbs = CurrentDb
strSQL = "UPDATE tblContacts SET tblContacts.Sel ect = -1 WHERE
tblContacts.Eve ntID = " & EventID
Debug.Print strSQL
dbs.Execute strSQL, dbFailOnError
Me.Refresh
End Sub
I appreciate that itwas unfortunate to have the field call 'Select' but
it's too late to change now.
tblContacts, tblEvents and tblAttendance with the latter linking
contacts to particular events.
The tblContacts table has a Yes/No field called 'Select".
When we want to view the Contacts for a particular event, we do so in
a continuous form driven by a query.
What we want to do is have a button that will update all the 'Select'
boxes to Yes within this event only. I've tried the following but it
doesn't work. Can someone tell me what's wrong?
Private Sub Command97_Click ()
Dim strSQL As String
Debug.Print strSQL
Set dbs = CurrentDb
strSQL = "UPDATE tblContacts SET tblContacts.Sel ect = -1 WHERE
tblContacts.Eve ntID = " & EventID
Debug.Print strSQL
dbs.Execute strSQL, dbFailOnError
Me.Refresh
End Sub
I appreciate that itwas unfortunate to have the field call 'Select' but
it's too late to change now.
Comment