Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Oct 2003
    Location
    Guelph, Ontario, Canada
    Posts
    428
    Thanks
    0
    Thanked 0 Times in 0 Posts

    recurring parameter prompt (Access 2000 - all upda

    On a form, which keeps track of equipment, there are 4 tab pages. One tab page has two combo boxes - cboVendors and cboContacts.

    The RowSource for cboVendors is
    SELECT tblVendors.VendorID, tblVendors.Vendor
    FROM tblVendors
    ORDER BY tblVendors.Vendor;

    The RowSource for cboContacts is
    SELECT tblContacts.ContactID, tblContacts.VendorID, [tblContacts].[ContactFirst] & " " & [ContactLast] AS Contact
    FROM tblVendors INNER JOIN tblContacts ON tblVendors.VendorID = tblContacts.VendorID
    WHERE (((tblContacts.VendorID)=[Forms]![frmEquipment]![cboVendor]))
    ORDER BY tblContacts.ContactLast;

    The [Forms]![frmEquipment]![cboVendor] portion of the code is there to limit the records in cboContacts to those which apply to cboVendors.

    If I close the form from any of the other 3 tab pages, no problem. However, if I attempt to close the form from this tab control page, I get a parameter prompt for [Forms]![frmEquipment]![cboVendor]

    What causes this, and how do I correct it?

    I should also mention that the AfterUpdate event of cboVendors has code to Requery cboContacts.

    I tried putting the code for the cboContacts on the AfterUpdate event for cboVendors, and the same result happens.

    An interesting anomaly is that if I close the form by clicking the X in the upper right corner, the parameter prompt does not appear...it is when I close the form using a plain, ordinary, garden-variety command button that I get the parameter prompt.

    This makes no sense to me.

    Tom

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: recurring parameter prompt (Access 2000 - all upda

    This appears to be a known bug - see BUG: Enter Parameter Value Dialog Box Appears While Trying to Close a Form Window. A suggested workaround is to use

    DoCmd.Echo False
    DoCmd.Close
    DoCmd.Echo True

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

    Re: recurring parameter prompt (Access 2000 - all upda

    You might also try not using the full forms!frmEquipment!cboVendor. Instead, just use [cboVendor]. This only works with Listbox and Combobox rowsources that are an SQL SELECT statement.

    You might also restrict how the form can be closed. Put a Close button on the form, and set the ControlBox property of the form to False so users can't hit the little "x" to close.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    4 Star Lounger
    Join Date
    Oct 2003
    Location
    Guelph, Ontario, Canada
    Posts
    428
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: recurring parameter prompt (Access 2000 - all

    Hans
    Thanks for the tip about the Access bug. The work-around works fine.

    Mark
    Your solution - just use [cboVendor] rather than the full reference - works as well.
    As for restrictng the user from hitting the small X to close the form...the strange thing was that the parameter did not appear when hitting the X to close...it only appeared when trying to close the form with a command button.

    Thanks to both Hans and Mark for your valued assistance.

    Tom

Posting Permissions

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