Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012
    Posts
    89

    Unanswered: LookUp auto fill (all textboxes)

    Hi i need some help with a certain lookup text box with the name "Sirname" when the combo box is used i want the textboxes "firstname" and "firm" also to be auto filled....
    With all that i still want to add new records (Sirname, Firstname, Firm)
    i hope that this is possible

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Set up your Combobox using the Wizard and include the Fields you need, from Left-to-Right.

    If, in the Combobox, they appear as

    Sirname Firstname Firm

    the code (substituting your actual Control names, of course) would be

    Code:
    Private Sub YourComboBox_AfterUpdate()
       Me.txtSirname =  Me.YourComboBox.Column(0)
       Me.txtFirstname = Me.YourComboBox.Column(1)
       Me.txtFirm = Me.YourComboBox.Column(2)
    End Sub
    The txtSirname, txtFirstname and txtFirm Controls have to be Bound to Fields in the underlying Table/Query.

    Notice that the column index is Zero-based, i.e. the first column is referred to as Column(0), the second as Column(1) and so forth .

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    May 2012
    Posts
    89
    Quote Originally Posted by Missinglinq View Post
    Set up your Combobox using the Wizard and include the Fields you need, from Left-to-Right.

    If, in the Combobox, they appear as

    Sirname Firstname Firm

    the code (substituting your actual Control names, of course) would be

    Code:
    Private Sub YourComboBox_AfterUpdate()
       Me.txtSirname =  Me.YourComboBox.Column(0)
       Me.txtFirstname = Me.YourComboBox.Column(1)
       Me.txtFirm = Me.YourComboBox.Column(2)
    End Sub
    The txtSirname, txtFirstname and txtFirm Controls have to be Bound to Fields in the underlying Table/Query.

    Notice that the column index is Zero-based, i.e. the first column is referred to as Column(0), the second as Column(1) and so forth .

    Linq ;0)>
    But the LookUp is from an other table.
    And when i set [tablename].[txtSirname].collomn(0)
    Then i get code error 2465...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •