Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box to open subform showing requested records.

Status
Not open for further replies.

applevacross

Technical User
Jul 14, 2005
41
US
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
 
Hi applevacross

Have you check what is being returned from the combo box? You maybe be expecting a text string and the combo is returning a number and therefore the search is never found. Try putting the result from the combo in a temp textbox to see if its what you are expecting.

Ian Mayor (UK)

Program Error
Programmers do it one finger at a time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top