Results 1 to 7 of 7
  1. #1
    littlejib is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    3

    Combobox refrence showing up as a Parameter

    I made a form that has a combobox that references the combo box above it, and it all worked fine, then I moved it into a navigation form and it stopped working. This was because the source was still using the static reference of the standalone form, not the subform it is now. So I've changed the row source a number of times, but each time, when run, access fails to find it, instead asking for a parameter to be input. The lines

    The Nav form is Navigation_Form, the subform is MCR_Log, the combo box is Affected_Subservices and the referenced combobox is Affected_Services.


    The code
    Code:
     Forms!Navigation_Form!MCR_Log.Form!Affected_Services
    or
    Code:
    Me!Affected_Services
    does not work, even if I change the bangs and dots around.

    I can't attach the file to this forum, so here is a dropbox link to have a play around.

    Bonus Question, I want the first combobox to accept multiple arguments, and the second to display all the subservices under each service, would the record source for that look something like
    Code:
    SELECT Subservices.Subservice FROM Subservices WHERE Subservices.Parent = Me!*Affected_Services*;
    ?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Review: https://www.accessforums.net/forms/t...orm-32053.html

    The Me qualifier works only in VBA, not in Access objects.

    AFAIK, a multi-select combobox works only when bound to a multi-value field. A listbox can be multi-select bound or unbound.

    No, a WHERE clause cannot just reference multi-select combobox or listbox and capture all the items. Requires code to build a string from items selected in multi-select listbox. Review: http://allenbrowne.com/ser-50.html

    If you want cascading comboboxes, review: http://www.datapigtechnologies.com/f...combobox2.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    littlejib is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    3
    Ok, June, the Me qualifier doesn't work in VBA, but I still can't refrence the combobox.

    If I use a standalone version of the form, the control
    Code:
    Forms!MCR_Log!Affected_Services
    allowes me to do what I want to do. But I can't refrence it when it's a subform in a navigation form. I've tried
    Code:
    Forms!Navigation_Form!MCR_Log.Form.Affected_Services
    Forms!Navigation_Form!MCR_Log.Form!Affected_Services
    z
    Amoung other, be the refrence cannot find the combobox. This is my main problem, the cascading combo boxes work in a standalone form, but not in the navigation form

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The Me qualifier works ONLY in VBA.

    Did the referenced link about Navigation form help?

    Is this a web database? I would not use Navigation form unless had to build web database and I have never built a web database.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    littlejib is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    3
    It's not a web database, just something I'm developing to help people at work, apart from using a navigation form, is there another way to make multiple forms user friendly.
    The refrenced post didn't help his solution was to refrence the box like this
    Code:
    [Forms]![NavigationForm]![NavigationSubform]![FnameTxt]
    But that doesn't work, no does adding in .Form behind the subform, or switching the bangs for dots

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I would use a tab control instead of Navigation control/form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    In your expression Forms!Navigation_Form!MCR_Log.Form!Affected_Servic es, what does MCR_Log.Form represent?

    If it is the name of the subform, then that is your error - subforms are not a part of the Forms! collection. To refer to a control on a subform you need something like this:

    Me!subformcontrolname.form!Affected_Services

    where subformcontrolname is the name of the control containing the subform, not the name of the subform itself.

    The Me! works fine, as long as it is in the VBA of the main form.

    HTH

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 42
    Last Post: 11-27-2013, 08:55 PM
  2. Replies: 1
    Last Post: 06-19-2013, 12:32 AM
  3. Report showing wrong parameter
    By Andrea in forum Reports
    Replies: 1
    Last Post: 09-28-2012, 12:04 AM
  4. Problem with Xzip.dll refrence
    By sheerkoshan in forum Programming
    Replies: 1
    Last Post: 01-17-2011, 05:38 AM
  5. Parameter Query with Combobox?
    By Krs13 in forum Forms
    Replies: 3
    Last Post: 12-21-2010, 06:15 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums