ST4RCUTTER
Registered User.
- Local time
- Today, 08:27
- Joined
- Aug 31, 2006
- Messages
- 94
Some of my users have asked that I create a simple search form that will let them view several fields for each record and then select the desired record using record selectors along the left edge of the form. Once clicked, I will use the Form_Click event to display the same record on the main form "frm_recordentry".
Simple enough task. The subform was easily created but I'm having trouble getting the FindFirst code to work. Again, my goal is to select the TaskID value using this search form and then find the first matching record on the form "frm_recordentry" and jump to it. I can then add code to automatically close the search form. Here is what I've been working with but I think my syntax is incorrect. I keep getting object not found errors so Access is not able to resolve the form object for "frm_recordentry"...at least that is what I think:
My code:
Simple enough task. The subform was easily created but I'm having trouble getting the FindFirst code to work. Again, my goal is to select the TaskID value using this search form and then find the first matching record on the form "frm_recordentry" and jump to it. I can then add code to automatically close the search form. Here is what I've been working with but I think my syntax is incorrect. I keep getting object not found errors so Access is not able to resolve the form object for "frm_recordentry"...at least that is what I think:
My code:
Code:
Private Sub Form_Click()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[Forms]![frm_recordentry]![TaskID] = '" & Me![TaskID] & "'"
If Not rs.EOF Then [Forms]![frm_recordentry].Bookmark = rs.Bookmark
End Sub