applevacross
Technical User
Good morning all, I have a search frame which is set to toggle between two combo boxes 1 to search for user, 1 to search for serial.
I'd like the user combo on click to open my subform and show all records held by that particular person, ie. computer, laptop, monitor etc. I'm guessing I can add this function to the after update or on click request. However, when trying to do so, the sub form does not open with any data. How can I make this open to show the records I wish to have shown?
Thanks to all in advance
Private Sub Combo106_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Serial #] = '" & Me![Combo106] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo108_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Users] = '" & Me![Combo108] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub SearchFrame_AfterUpdate()
'Make the appropriate combo visible
If Me!SearchFrame.Value = 1 Then
Me!Combo106.Visible = True
Me!Combo108.Visible = False
Else
Me!Combo106.Visible = False
Me!Combo108.Visible = True
End If
End Sub
I'd like the user combo on click to open my subform and show all records held by that particular person, ie. computer, laptop, monitor etc. I'm guessing I can add this function to the after update or on click request. However, when trying to do so, the sub form does not open with any data. How can I make this open to show the records I wish to have shown?
Thanks to all in advance
Private Sub Combo106_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Serial #] = '" & Me![Combo106] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo108_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Users] = '" & Me![Combo108] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub SearchFrame_AfterUpdate()
'Make the appropriate combo visible
If Me!SearchFrame.Value = 1 Then
Me!Combo106.Visible = True
Me!Combo108.Visible = False
Else
Me!Combo106.Visible = False
Me!Combo108.Visible = True
End If
End Sub