T
trekgoes2malaysia
When I open a form, I would like Access to go to a specified record
that meets the criteria in a certain field using the
'DoCmd.FindRecord' command in VBA. Unfortunately I have not had much
success this way. Can you explain how I can find a record based on
the contents of a field on the form. Below is my VBA code.
Private Sub Workouts_Click()
Dim stfilter As String
Dim stFormName As String
Dim getdateid As Integer
stFormName = "Datelog"
getdateid = Me!Workouts.Value
stfilter = "[athleteid]=" & Me![Athleteid]
DoCmd.Close, acform, Me!Workouts
DoCmd.OpenForm stFormName, , , stfilter
DoCmd.FindRecord getdateid,,,,,acAll
End Sub
that meets the criteria in a certain field using the
'DoCmd.FindRecord' command in VBA. Unfortunately I have not had much
success this way. Can you explain how I can find a record based on
the contents of a field on the form. Below is my VBA code.
Private Sub Workouts_Click()
Dim stfilter As String
Dim stFormName As String
Dim getdateid As Integer
stFormName = "Datelog"
getdateid = Me!Workouts.Value
stfilter = "[athleteid]=" & Me![Athleteid]
DoCmd.Close, acform, Me!Workouts
DoCmd.OpenForm stFormName, , , stfilter
DoCmd.FindRecord getdateid,,,,,acAll
End Sub