airhendrix13
Registered User.
- Local time
- Today, 13:08
- Joined
- Dec 19, 2006
- Messages
- 20
Hi,
I want to try to get my combo box to update the rest of my text boxes. For example, I have Column A, B, and C in my combo box, when I select for example A, I want all the information for row A to show up in my text boxes. I have several columns in each row in my table and each column in the table should correspond to a text box in my form.
Here is what I have.
Private Sub Combo26_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
I put this in "AfterUpdate" but I keep getting a compiling error. Any suggestions or just new ideas to accomplish my task easier?
Thanks a lot in advance!
P.S. I'm new to access so please keep that in mind.
I want to try to get my combo box to update the rest of my text boxes. For example, I have Column A, B, and C in my combo box, when I select for example A, I want all the information for row A to show up in my text boxes. I have several columns in each row in my table and each column in the table should correspond to a text box in my form.
Here is what I have.
Private Sub Combo26_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
I put this in "AfterUpdate" but I keep getting a compiling error. Any suggestions or just new ideas to accomplish my task easier?
Thanks a lot in advance!
P.S. I'm new to access so please keep that in mind.