G
Guest
I have two tables linked together via a User ID. The table containing the user's info uses the Look up wizard to find the user's name (so the relationship is tblUsers.Name -> tblPersonalInfo.[User ID]). Using this set-up, I have created a form that cycles through all the users and a subform to display their personal info for editing or adding records to (i.e work performance based on date).
I am unsure of the syntax for how I would go about finding a record for a given date (unbounded text box) - since the date is on the subform, can I just do a find using the date field or do I need to include the user ID? I put the following routine on the AfterUpdate event of the date control:
Private Sub Date_AfterUpdate()
Dim inputDate As Date
inputeDate = Me!Date
Me.RecordsetClone.FindFirst "Date = " & inputDate
If Me.RecordsetClone.NoMatch Then
Me.Undo
MsgBox "Record not found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
Me.RecordsetClone.Close
End Sub
Unfortunately, when I enter a date for which a record exists, I get the message "Record not found" - does anyone know what I am doing wrong?
Thanks in advance,
Carrie
I am unsure of the syntax for how I would go about finding a record for a given date (unbounded text box) - since the date is on the subform, can I just do a find using the date field or do I need to include the user ID? I put the following routine on the AfterUpdate event of the date control:
Private Sub Date_AfterUpdate()
Dim inputDate As Date
inputeDate = Me!Date
Me.RecordsetClone.FindFirst "Date = " & inputDate
If Me.RecordsetClone.NoMatch Then
Me.Undo
MsgBox "Record not found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
Me.RecordsetClone.Close
End Sub
Unfortunately, when I enter a date for which a record exists, I get the message "Record not found" - does anyone know what I am doing wrong?
Thanks in advance,
Carrie