Text Boxes Showing Information from a Row in a Form Corresponding from a Combo Box

airhendrix13

Registered User.
Local time
Yesterday, 18:24
Joined
Dec 19, 2006
Messages
20
Hi,

I have a form that has several text boxes that correspond to a cell in a row. One of the columns contains just numbers 1-300. Now what I need is a combo box that contains the numbers 1-300 and when one of those numbers is selected I need it to import all the information from the same row into the correct text boxes.

For example when the number 3 is selected it will take the row with the number 3 in it, take all of the cells and import them into the right text box.

Thanks a bunch!
 
Hum... Have you ever tried selecting something in a combo box with that many options... I don't think you'll like it. (Just my opinion :))
 
well actually there are several combo boxes split up between multiple forms. So there is like 1-30 on one form 31-60 on another and so on. I did this because each form represents the type of equipment that will be searched.
 
If the form is bound to the query containing the data you could use the combo box as a criteria in a query or use it as the form's filter...
 
If you put the following code in the after update of the combo box it will go to the record where the ID =s the selected one, as it has serached the recordset that is attached to the current form

Good Luck

Private Sub cbo_Surname_AfterUpdate()
Dim rs As Object,
dim x As Integer
If Not (IsNull(Me!cbo_Surname)) Then

x = cbo_Surname
Set rs = Me.Recordset.Clone
rs.FindFirst "[Tenantid] = " & x
If rs.NoMatch Then
MsgBox ("cannot find this tenant")
Else
Me.Bookmark = rs.Bookmark
End If
rs.Close

End If
Set rs = Nothing
End Sub
 

Users who are viewing this thread

Back
Top Bottom