Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    form close (Access 2002)

    I have a simple form with one combo box and one list box. The combo box allows me to pick a city (via row source SQL statement) and then display all those customers who live in that city in the list box (also via row source SQL statement with the criteria set to [forms].frmCustomer!cboCity). The link works fine but when I exit the form, Access 2002 asks me for the parameter value [forms].frmCustomer!cboCity. If I run the same form in Access 2000, I don

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: form close (Access 2002)

    Are you opening the *same* database in 2000 and 2002 or did you create a new database in 2002 and import the objects, or what? Can you zip up a database with the form and the necessary tables and queries to support it? The changes between the two versions should have caused that kind of behavior, but if you created a whole new database in 2002, you could have picked up some unnecessary subdatasheets that could cause a delay.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: form close (Access 2002)

    here is the zip file with the two tables and two forms. frmTest will open (via Close and Open button) frmCustomer but very slowly (on a Celeron 700Mhz with 256MB RAM) running Access 2002. If this database is run under Access 2000, frmCustomer can be loaded significantly faster. The database was created in Access 2002 with 2000 file format and has less than 5 records in each table.

    Once a while when I get out of frmCustomer (after picking a city), I may be prompted for the parameter value forms.frmCustomer!CityID when I exit the form (via the Exit button). This prompt does not always show up, only intermittenly. If I don't pick any city from the combo box, then I will never get the prompt at all.

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: form close (Access 2002)

    Try attaching it again. You can't preview or spellcheck after you've browsed to your attachment.
    Charlotte

  5. #5
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: form close (Access 2002)

    Sorry, here is the file.
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: form close (Access 2002)

    I'm not seeing the behavior you reported when I switch back and forth between A2k and AXP.

    I did notice that you are opening and closing forms for no apparent reason. You close frmTest when you open frmCustomer, and there's a line in frmCustomer to open frmTest again. If you just hide frmTest instead of closing it, you'll save time. You do have subdatasheets turned on, and they will sap performance, particularly with linked tables. You also have Name AutoCorrect turned on, and it has a habit of creating weird behaviors too.
    Charlotte

  7. #7
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: form close (Access 2002)

    I have had same problem when working with Access 2K databases in Access 2002 (aka Access XP) (using A2K file format). See previous post: Bogus Parameter Prompt When Close Form. I never did find solution or explanation for why this occurs. As workaround, what you can do is set listbox's RowSource property in code when city is selected from City combo, obviating the need for form reference in the listbox RowSource SQL statement (RowSource property should be left blank). Example of modified combo After Update event:

    Private Sub cboCity_AfterUpdate()

    Dim strSQL As String
    Dim strCityID As String

    If Not IsNull(Me.cboCity) Then
    strCityID = Me.cboCity
    strSQL = "SELECT CID, CName, CityID FROM tblCustomer " & _
    "WHERE CityID='" & strCityID & "' ORDER BY CName;"

    lstCustomer.RowSource = strSQL
    Else
    lstCustomer.RowSource = ""
    End If

    End Sub

    If you do find out cause for this bug, I'd like to know. Also, as previously noted, you have Subdatasheet property set to "Auto" in both tables, recommend set to "None" to improve performance in whichever version of Access is being used.

    HTH

  8. #8
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: form close (Access 2002)

    Thanks for the advice. As you suggested in previous post, if you click on the X to close the form, this bug does not occur. I coded the form close event with "docmd.openform "name of your form to open" in addition to the on click event with the Exit command button. This seems to get rid of the bogus parameter problem.

    What it bugs me is that this bogus parameter problem does not always come up and it is not a problem in A2K at all.

    I also notice that if you create a list box with values that you entered, in A2K, you don't need the quotation marks such as "A"; "City A"; "B"; "City B"...... and everything works fine. If you port this program into AXP, it bombs. You must use the quotation marks for the value list inside the combo box.

    Thanks for your advice again.

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: form close (Access 2002)

    ComboBoxes and Listboxes are a little different in AXP than they were in A2k, so I'm not surprised by this particular difference. In AXP, you can use AddItem to populate combo and listboxes, which was previously only available in VB and in MSForms in other Office apps.
    Charlotte

  10. #10
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: form close (Access 2002)

    I think Mark is correct. That stupid parameter msg is a bug in AXP. The trouble is that it does not always come up.

Posting Permissions

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