3 replies
by john_wills
I have many such forms. One selects a client by SSN(the key) or surname, and uses these event procedures:
Private Sub FindByLastName_AfterUpdate()
Dim rs As Object
Me.Filter = ""
Set rs = Me.Recordset.Clone
rs.findfirst "[SSN]='" & Me.FindByLastName & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub FindBySSN_AfterUpdate()
Dim rs As Object
Me.Filter = ""
Set rs = Me.Recordset.Clone
rs.findfirst "[SSN]='" & Me.FindBySSN & "'"
Me.Bookmark = rs.Bookmark
End Sub
I have no macro. There is a query for each drop-down, with SSN as bound column in both, and a larger one for form data.
by shanghai sam
by fernstar
If you have a combo box from which the user selects the Company, it is quite simple to populate other fields.
Firstly ensure that the Company combo box has all the fields you require to populate the form.
Then on the after update event of the Company combo box you can refer to the fields associated with the company - like state etc. by referring to cboCompany.Column(1) this will give you the value in the second column associated with the selected Company. So you can then say,
Me!txtState = Me!cboCompany.Column(1)
If you do not want to display all the other fields in the combo box simply make their length zero in the parameter specifi\ying the column widths.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending