Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Posts
    559

    Unanswered: Prompting for parameter

    On the attached DB, if you open the frmTWPoC it's asking for the user to enter a parameter. I can't figure out what I did wrong since I almost copied it from another DB I was working on.

    The same goes for passing the "Organization" from the frmSearchOrg to the frmTWPoC field for "Organization", it won't pass the value.

    Can anyone figure out what I'm overlooking by pure stupidity on my part?

    Thanks!
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    A common cause for this phenomenon is that you have a query in a rowsource property (a combo or list box or an unbound subform is the usual culprit) which is looking for a value which it canot see. Often it is a value in a form field which at the time is unpopulated. This can occur because of the peculiar sequence of events with which MS opens and closes a form. (Try and put a few Msgboxes in the Open() and Current() functions in VBA to see what I mean).
    One of the workarounds I use is to leave the rowsource blank, then insert the query with VBA on opening, following up with a Requery. Similarly, you should then return the rowsource to blank before closing.

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I do everything Jim does except the last part on unloading the rowsource to blank before closing. Jim - why do you do this? Doesn't this happen automatically when the form closes (provided it was left blank in the beginning)?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Primary Agent in the subform contains a reference to =Forms!subfrmTopic!AgentID. That will only work if the form is a mainform. Now that you've placed it on your mainform as a subform, that reference needs to be adjusted accordingly.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    My reason for cleaning out the rowsource in combo boxes is due to the order in which MS closes down the form. Subforms and other controls with similar references are the first things to be opened and the last things to be closed. Hence, if you have a subform or a combo box which draws its rowsource from another control in the form and that control is closed, for some reason which I cannot explain, the combo boxes relying on the control seem impelled to refresh their contents and produce these annoying but mainly harmless prompts for parameters. I have no idea why this should happen. I suspect that different functions were designed by different development teams and they weren't talking to one another. Read "I sing the body electronic: a year with MS on the multi-media frontier" by Fred Moody if you find this incredible.
    The main reason for generating the rowsource, is that I sometimes have deeply nested table structures and selecting a key from one table provides a list of keys in its child table in the next combo box and so on until the last set of keys at the lowest level populates a subform, report or whatever.

  6. #6
    Join Date
    Aug 2006
    Posts
    559
    Alright, I'm going to take a look at what I did and why it works on my other DB but not on this one. Thanks for the help everyone!

Posting Permissions

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