T
trekgoes2malaysia
I am trying to update a field (txtcount) on a form everytime another
field (dateid) on my form changes. I am using the OnCHange event to
do this but I can't seem to get access to read the event VBA code let
alone actually perform the update on the desired field when dateid
changes. I have included my code below. Any help is really
appreciated.
Private Sub dateid_Change()
Dim stQueryName As String
Dim getcount As Integer
stQueryName = "workoutcount"
sql = "[athleteid] = " & Me![Athleteid] & " and " & " [dateid] =
" & Me![dateid]
getcount = DLookup("[Count Of log]", stQueryName, sql)
Me!Txtcount.Value = getcount
End Sub
field (dateid) on my form changes. I am using the OnCHange event to
do this but I can't seem to get access to read the event VBA code let
alone actually perform the update on the desired field when dateid
changes. I have included my code below. Any help is really
appreciated.
Private Sub dateid_Change()
Dim stQueryName As String
Dim getcount As Integer
stQueryName = "workoutcount"
sql = "[athleteid] = " & Me![Athleteid] & " and " & " [dateid] =
" & Me![dateid]
getcount = DLookup("[Count Of log]", stQueryName, sql)
Me!Txtcount.Value = getcount
End Sub