I am using the code below to open a form to a specific record based on record count. The problem is that the message box shows the proper record count, but it always opens the first record.
Any thoughts
Private Sub BtnDaily_Click()
Dim RecCnt As Integer
Dim FileEnd As Integer
FileEnd = DCount("RecordDate", "TblSummary")
RecCnt = 1
'Determine if todays record has started
DoCmd.GoToRecord , , acFirst
Do While RecCnt < FileEnd + 1
If RecordDate = Date + NewDay Then
GoTo Found
End If
RecCnt = RecCnt + 1
DoCmd.GoToRecord , , acNext
Loop
DoCmd.OpenForm "FrmDailyAdd", acNormal, , , , , RecCnt
LDate = RecordDate
Exit Sub
The above code works great.
Found:
MsgBox RecCnt
DoCmd.OpenForm "FrmDailyUpdate", acNormal, , , , , RecCnt
End Sub