I have a form that I wanted to create a way to search for a kit and have all the fields update to that kits information. When I created the combo box I did it according to the kit table so all the available kits are listed but it doesn't update the rest of the information that goes with it. Do I need to requery and if so how would I do the script for it?
This is the script so far
Private Sub cmdFindKit_Click()
On Error GoTo Err_cmdFindKit_Click
Screen.PreviousControl.SetFocus
DoCmd.FindRecord "Kit", acEntire, True, acSearchAll = _
True, True, acAll, True
Exit_cmdFindKit_Click:
Exit Sub
Err_cmdFindKit_Click:
msgBox Err.Description
Resume Exit_cmdFindKit_Click
End Sub
Private Sub Combo46_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Kit] = '" & Me![Combo46] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
This is the script so far
Private Sub cmdFindKit_Click()
On Error GoTo Err_cmdFindKit_Click
Screen.PreviousControl.SetFocus
DoCmd.FindRecord "Kit", acEntire, True, acSearchAll = _
True, True, acAll, True
Exit_cmdFindKit_Click:
Exit Sub
Err_cmdFindKit_Click:
msgBox Err.Description
Resume Exit_cmdFindKit_Click
End Sub
Private Sub Combo46_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Kit] = '" & Me![Combo46] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub