i am at a loss as to what to do. It seems a pretty simpel isue. However I can not find a solution. The problem: "How to find a specific value in field of a record on a subform using an unbound field in the mainform as searchfield and after that set the focus on that specific record or field on the subform". I tried the following code, but that was not working:
Private Sub ZoekGoedBtn_Click()
Dim strSearchValue As Variant Dim intRecordNumber As Integer ' Get the value of the search field from the main form. strSearchValue = Me.Zoekgoed.Value ' Find the first record in the subform that matches the search value.
intRecordNumber = Me.Tussentabel_Subformulier.FindFirst(strSearchValue) ' If a record was found, set the focus to that record. If intRecordNumber <> 0 Then Me.Tussentabel_Subformulier.SetFocus End If
End Sub
For your information: 'Zoekgoed is an unbound searchfield in the main form. 'Tussentabel_Subformulier' is the subform. It seems that .FindFirst is not working. Can you help me out or provide a solution. Thanx again.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.