Can anyone help??!! I've been trying to get this code below to work, and for some reason it's fully working... The user enters a Date into the txtDate text box and when the Command Button is clicked the recordset is serched, looking for a matching DOB. When the record is found it drops out of the loop, but for some reason is not navigating to the record.
Skep has been trying numerous things, and as yet we have had no success. Any help would be greatly appreciated!!
Dim rst As Recordset
Dim myBookmark As Date
Set rst = CurrentDb.OpenRecordset("ClientInfo", dbOpenDynaset)
On Error Resume Next
rst.MoveFirst
Dim MyValue As Date
MyValue = txtDate
Do While Not rst.EOF
If rst.Fields("DOB" = MyValue Then
myBookmark = rst.Bookmark
Exit Do
End If
rst.MoveNext
Loop
If rst.Fields("DOB" <> MyValue Then
MsgBox "No record for that patient", vbInformation, "LMTC Database"
txtClientSrch.Text = " "
txtClientSrch.SetFocus
Exit Sub
End If
Me.RecordsetClone.FindFirst "[DOB] = " & MyValue
Me.Bookmark = Me.RecordsetClone.Bookmark
Skep has been trying numerous things, and as yet we have had no success. Any help would be greatly appreciated!!
Dim rst As Recordset
Dim myBookmark As Date
Set rst = CurrentDb.OpenRecordset("ClientInfo", dbOpenDynaset)
On Error Resume Next
rst.MoveFirst
Dim MyValue As Date
MyValue = txtDate
Do While Not rst.EOF
If rst.Fields("DOB" = MyValue Then
myBookmark = rst.Bookmark
Exit Do
End If
rst.MoveNext
Loop
If rst.Fields("DOB" <> MyValue Then
MsgBox "No record for that patient", vbInformation, "LMTC Database"
txtClientSrch.Text = " "
txtClientSrch.SetFocus
Exit Sub
End If
Me.RecordsetClone.FindFirst "[DOB] = " & MyValue
Me.Bookmark = Me.RecordsetClone.Bookmark