Results 1 to 4 of 4
  1. #1
    loopyl00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    3

    adding an autofill field from another table

    I have created a combo box

    SELECT Vendeurs.VendeurID, Vendeurs.[Last Name], Vendeurs.[First Name] FROM Vendeurs GROUP BY Vendeurs.VendeurID, Vendeurs.[Last Name], Vendeurs.[First Name];

    This successfuly returns the first name and last name, and i'm able to autofill a text box with the first name pulled from the combo box



    I want to add another txt box on the form that gives me their team name. I have a FK in the Vendeurs table linked to the [teamid] in the [team table]. When I select the name in the combobox I want to autofill the team name

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    use dlookup(), or add the team name in the box's sql statement, via a join.

  3. #3
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60
    This topic interests me... what is a join? I'm go to the MS site and lookup "dlookup()" now...


  4. #4
    loopyl00 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2011
    Posts
    3
    Have created a query [Vendeur Equipe] which has 3 fields [VendeurID] - [Equipe] - [Last Name]

    in the AfterEvent update of the combobox

    Private Sub LastNameC_AfterUpdate()
    Me.FirstName = Me.LastNameC.Column(2)
    Me.VendeurIDtxt = Me.LastNameC.Column(0)
    Me.Equipetxt = DLookup("equipe", "Vendeur Equipe", Me.VendeurIDtxt)
    Me.Emailtxt = DLookup("email", "Vendeur Email", Me.VendeurIDtxt)

    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 09-14-2010, 09:50 PM
  2. Autofill of a field based on another
    By MyWebdots in forum Forms
    Replies: 7
    Last Post: 07-12-2010, 05:00 AM
  3. Replies: 10
    Last Post: 04-21-2010, 01:16 PM
  4. Autofill form fields based on another field
    By ljs1277 in forum Access
    Replies: 3
    Last Post: 02-16-2010, 02:51 PM
  5. Autofill field based on autonumber field
    By frevilla in forum Forms
    Replies: 1
    Last Post: 09-11-2009, 02:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums