Consulting

Results 1 to 4 of 4

Thread: Solved: Access Forms Help

  1. #1

    Solved: Access Forms Help

    I have an Access application that has two forms. The first form is called "frmVendors" and the second form is called "frmVendorContacts" The second form "frmVendorContacts" is used to display specific detailed contact information about the Vendor selected on the first form (they are linked by ID numbers)

    After adding a new Vendor using the first form, I display the second form (frmVendorContacts) so that I can add a corresponding Contact record for the new Vendor. I have used the command
    DoCmd.OpenForm "frmVendorContacts", , , , acFormAdd to open a blank VendorContact form that will be filled with various contact info. I would like to automatically populate one of the text fields on the second form (conID) with a variable value from the first form (venID.) This variable (venID) gets its value from an auto-ID field on the first form.

    How do I do this? Sorry for my ignorance, I am only used to working with custom designed forms and using VB not these forms that are automatically created by Access using all these built in commands.

    Rollin

  2. #2
    VBAX Regular
    Joined
    Aug 2004
    Location
    Sacramento, CA
    Posts
    13
    Location
    Rollin-
    set the default value for conID to:
    =Forms!frmVendors!venID
    This will set the conID value to the venID value from the frmVendors form.

    It really sounds like you are doing a form with a subform type of application. If so, you can put the frmVendorContacts within the frmVendors form, then using the properties for the "subform" of frmVendorContacts, data tab, set the venID in the "Link Master Fields" and "Link Child Fields." Then the forms will automatically take care of populating the correct data in your sub-form (frmVendorContacts).

    Hope this helps,
    Vic

  3. #3
    Site Admin
    The Princess
    VBAX Guru Anne Troy's Avatar
    Joined
    May 2004
    Location
    Arlington Heights, IL
    Posts
    2,530
    Location
    Rollin: Was Vic able to help you here?
    If so, I'll mark it solved.
    ~Anne Troy

  4. #4
    Thanks Vic. That is exactly what I needed to know.


    Rollin

Posting Permissions

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