herbivorous
Technical User
I am working on a form with customer information that includes a subform that lists all customers to ease searching. When you click on a record in the subform (which just shows names, etc.), the data in the main form (address, and other info) syncs and everything is lovely.
My difficulty is with a text box I've added to the main form that finds records in the subform. I have set it up such that as you type in the search window, the subform scrolls to the best match -- type H and you get the first of the Hs, then E and you're to Heller, maybe, and then R and maybe you reach Herbert or Herbivorous. All fine, after some trial and error, using the recordset findfirst method.
However, the main form, whose update is triggered by an OnCurrent event procedure in the subform, does not update in response.
Is there a way to artificially trigger the current event, or to call that private sub? Or to even embed that procedure in my current procedure (since they are in different forms, a cut and paste approach doesn't seem to work.)
I'll paste my procedure here, in case it provides any clues
Private Sub searchwindow_KeyUp(KEYCODE As Integer, Shift As Integer)
Dim rst As DAO.Recordset, strCriteria As String
strCriteria = "[findname] Like '" & searchwindow.Text & "*'"
Set rst = Form_frmSearchNames.Recordset
rst.FindFirst strCriteria
Me!searchwindow.SetFocus
Me!searchwindow.SelStart = 99
End Sub
I'm a self-taught trial and error programmer, so this may all be ass-backward. It wouldn't be the first time. . .
My difficulty is with a text box I've added to the main form that finds records in the subform. I have set it up such that as you type in the search window, the subform scrolls to the best match -- type H and you get the first of the Hs, then E and you're to Heller, maybe, and then R and maybe you reach Herbert or Herbivorous. All fine, after some trial and error, using the recordset findfirst method.
However, the main form, whose update is triggered by an OnCurrent event procedure in the subform, does not update in response.
Is there a way to artificially trigger the current event, or to call that private sub? Or to even embed that procedure in my current procedure (since they are in different forms, a cut and paste approach doesn't seem to work.)
I'll paste my procedure here, in case it provides any clues
Private Sub searchwindow_KeyUp(KEYCODE As Integer, Shift As Integer)
Dim rst As DAO.Recordset, strCriteria As String
strCriteria = "[findname] Like '" & searchwindow.Text & "*'"
Set rst = Form_frmSearchNames.Recordset
rst.FindFirst strCriteria
Me!searchwindow.SetFocus
Me!searchwindow.SelStart = 99
End Sub
I'm a self-taught trial and error programmer, so this may all be ass-backward. It wouldn't be the first time. . .