Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modal Form to Match Current Record (A2K)

    I'm looking up Vendor table via cboVendor to locate a specific vendor.

    When found, the Vendor name and contact are displayed.

    Acme Screw & Gear =[cboVendor].[column](1)

    John Doe =[cboVendor].[column](2)

    This works perfectly..

    The situation can arise where there is no contact name and the user wants to add or change the contact name "on the fly".

    I created a Modal PopUp form using the Venor table as the data source and displaying the Vendor Name and the Contact Name fields.

    This works perfectly in that the form opens up from the Vendor table, but is sitting on the first record.

    What I would like to have happen is for the Modal Form to open up on the matching record of the Vendor I just looked up so that I can change John Doe to Mary Smith and have it refresh immediately.

    Would appreciate any help on this,
    Cheers,
    Andy

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Modal Form to Match Current Record (A2K)

    You need to specify a WHERE clause in your OpenForm method. See Access Help for more details, but essentially it would be:

    DoCmd.OpenForm "frmVendor",windowmode:=acDialog, wherecondition:="VendorID=" & cboVendor
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Modal Form to Match Current Record (A2K)

    Mark,

    Bang On! Worked exactly as I needed and you predicted. Thanks kindly for your quick response,
    Cheers,
    Andy

Posting Permissions

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