R
Rich_in_NZ
-Access 2003 (database in 2000 format) front end, MySQL server backend
Hi,
The issue I'm having seems to be a common one, but sadly my Google searches
have yet to find the remedy. I have a subform in datasheet view with a
'SELECT DISTINCT' query on a MySQL server table as it's Record Source. The
subform has a bound checkbox, which I want to be able to check to select a
specific record then run an update query.
When the checkbox is bound, the Click() event for the checkbox doesn't seem
to execute. I click the checkbox, no tick appears, and nothing happens. I put
a msgbox in to display the unique ID of the record I select but it never
appears.
I then tried using an unbound checkbox. This almost works as the Click()
event is detected and the update occurs for the selected record, but each
checkbox changes regardless of which checkbox I click.
The most annoying thing is that I have a copy of another database which
utilises checkboxes in a subform but it works fine. I copied the VBA code
exactly and it won't work. The only difference is that the record source of
the working subform is based on a local table, not a linked server table.
Any help would be most appreciated,
Rich
P.S: Here is the Click() event code.....
Private Sub chkReviewed_Click()
Dim dtNow
dtNow = Now()
MsgBox "QCP# = " & Me.QCP_, vbOKOnly
If Me.chkReviewed = True Then
Me.ReviewDate = dtNow
CurrentDb.Execute "UPDATE tblQCP_Server_Null SET ReviewDate='" &
Format(dtNow, "yyyy-mm-dd hh:nn:ss") & "' WHERE [QCP#]=" & Me.QCP_
Else
Me.ReviewDate = Null
CurrentDb.Execute "UPDATE tblQCP_Server_NotNull SET ReviewDate=NULL
WHERE [QCP#]=" & Me.QCP_
End If
[Forms]![frmReviewQCP].RefreshSubform5
End Sub
Hi,
The issue I'm having seems to be a common one, but sadly my Google searches
have yet to find the remedy. I have a subform in datasheet view with a
'SELECT DISTINCT' query on a MySQL server table as it's Record Source. The
subform has a bound checkbox, which I want to be able to check to select a
specific record then run an update query.
When the checkbox is bound, the Click() event for the checkbox doesn't seem
to execute. I click the checkbox, no tick appears, and nothing happens. I put
a msgbox in to display the unique ID of the record I select but it never
appears.
I then tried using an unbound checkbox. This almost works as the Click()
event is detected and the update occurs for the selected record, but each
checkbox changes regardless of which checkbox I click.
The most annoying thing is that I have a copy of another database which
utilises checkboxes in a subform but it works fine. I copied the VBA code
exactly and it won't work. The only difference is that the record source of
the working subform is based on a local table, not a linked server table.
Any help would be most appreciated,
Rich
P.S: Here is the Click() event code.....
Private Sub chkReviewed_Click()
Dim dtNow
dtNow = Now()
MsgBox "QCP# = " & Me.QCP_, vbOKOnly
If Me.chkReviewed = True Then
Me.ReviewDate = dtNow
CurrentDb.Execute "UPDATE tblQCP_Server_Null SET ReviewDate='" &
Format(dtNow, "yyyy-mm-dd hh:nn:ss") & "' WHERE [QCP#]=" & Me.QCP_
Else
Me.ReviewDate = Null
CurrentDb.Execute "UPDATE tblQCP_Server_NotNull SET ReviewDate=NULL
WHERE [QCP#]=" & Me.QCP_
End If
[Forms]![frmReviewQCP].RefreshSubform5
End Sub