Results 1 to 6 of 6
  1. #1
    dunamisqueen is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    3

    Autofill Multiple Fields in a Form from One Record in a Table


    Hi There:

    I'm relatively new to access. I have a form for Sales Transactions in which I have a combo box to select a producer's company name via a query. I want to be able to have an event automatically fill in the producer's contact name and information (i.e. mailingaddress, telephone, etc.) from the ProducerContactInformation table. The goal with this Sales Transactions form is to be able to create a report that is actually a sales agreement that gets sent to the producer. I know how to set up creating the report, I just need to know how to autofill the contact information fields. How can I do this relatively easily and quickly?

    I really appreciate any help. I'm a bit stumped. Thanks a bunch!

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    use dlookup()

    it's slow, but you probably don't have many fields to fill. use this syntax:
    Code:
    private sub combox_afterupdate
    
       me.address = dlookup("addressfield", "table", _
          "[criteriafield] = '" & me.companyname & "'")
    
    end sub
    write a lookup for every field that's needed.

  3. #3
    dunamisqueen is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    3
    I've tried the dlookup method for the group of fields that I need to autofill, but it won't work. It fills the first field only and nothing happens with the rest of them. Have I input the dlookup incorrectly or have I created a part of my database incorrectly. My dlookup that didn't work correctly was all listed under the one combox_afterupdate.

    Any further assistance would be greatly appreciated. Thanks.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    if you did do something incorrectly in the database it's not worth fixing unless it's big. But you won't know unless you've studied proper setup techniques.

    It's impossible to know what the problem is here, but it is most likely a lack of proper criteria to input because that particular piece of data is not in one of the tables you want to pull from (hence no criteria to use in the lookup function).

    but if you upload it I'm sure I or someone else can get it back to you in a matter of minutes. If you do, give the:

    form
    cbox control name
    fields to fill
    what to fill them with

  5. #5
    dunamisqueen is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Posts
    3

    Smile

    Quote Originally Posted by ajetrumpet View Post
    if you did do something incorrectly in the database it's not worth fixing unless it's big. But you won't know unless you've studied proper setup techniques.

    It's impossible to know what the problem is here, but it is most likely a lack of proper criteria to input because that particular piece of data is not in one of the tables you want to pull from (hence no criteria to use in the lookup function).

    but if you upload it I'm sure I or someone else can get it back to you in a matter of minutes. If you do, give the:

    form
    cbox control name
    fields to fill
    what to fill them with
    Thanks so much for all your help! I've found the issue. Like you said, some of the criteria wasn't quite right. Got it corrected and it is all working now! Thank you again, so much!

  6. #6
    NateJames is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    1

    Thanks

    Thanks for your help, I was able to read this post and solve a similiar problem

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

Similar Threads

  1. How To Fill In Multiple Fields From A Form
    By SamanthaSamuels in forum Access
    Replies: 3
    Last Post: 08-16-2010, 12:13 PM
  2. Autofill form fields based on another field
    By ljs1277 in forum Access
    Replies: 3
    Last Post: 02-16-2010, 02:51 PM
  3. Replies: 1
    Last Post: 12-10-2009, 08:41 PM
  4. Autofill form fields
    By roboticsguy1988 in forum Forms
    Replies: 1
    Last Post: 08-10-2009, 08:56 AM
  5. One table multiple fields identical properties.
    By swampdonkey in forum Queries
    Replies: 2
    Last Post: 09-29-2006, 10:53 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