Results 1 to 6 of 6
  1. #1
    pschonen is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    4

    Macro works on form, but not when form is on a Nav Form

    I have a Web Database i have built. It is homed on Sharepoint access services. I dont think any of that is the problem however.


    I have a button on a form that brings up a multirecord form based on a table, filtered by a field in the original form. The button runs the "openform" macro.
    The button works WONDERFULLY when i open JUST the form on which the button is located. However, this form is located on a navigation form (Actually a nav form ON a higher level nav form). When i open the form through the nav forms it no longer works, telling me there is an error in the expression.

    It gives the same error whether i load it locally in Access or via the website.

    Any Ideas how i can resolve this?

  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,929
    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
    pschonen is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    4
    OK... so if i understand this correctly, I think i just need info on the Heirarchy of nav forms and how to fully address a control on a form that is on a nav form. I have added a screen shot below. As you can see i have 2 layers of Navigation, vertical tabs then horizontal tabs, before i get to an actual form built from a query.
    The button brings up a form in a separate window (dialog box). I have added the embedded macro as well.
    If anyone can direct me to the proper heirarchy for forms on nav forms, I would be appreciative.
    Attached Thumbnails Attached Thumbnails Access-shot1.jpg   Access-shot2.jpg  

  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,929
    Did you fully review the referenced link and the additional links? Do you understand why the suggestion was to use TempVars? Trying to reference through multiple layers of navigation form sounds really difficult. I've never built web db and have no use for navigation form.

    As I understand it, the referencing is like:

    Forms!mainformname.NavigationForm.Form.controlname

    Bing: Access navigation form reference subform
    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
    pschonen is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    4
    Well when at first it wasn't working even straight on the form directly, I tried setting a tempvar siteref=[Site_ID] then in the query underlying the form i was calling, i set the parameter siteref and used siteref in the QUERY as a criteria.

    Problem is, any time i specify a parameter that is not specifically a form control or something similar, it asks for the input instead of it being passed from the calling object.

  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,929
    I've never used TempVars but possibly they can't be referenced in query.
    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.

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

Similar Threads

  1. Form Button With Macro To Open Another Form
    By data808 in forum Macros
    Replies: 9
    Last Post: 01-27-2014, 11:54 AM
  2. Replies: 7
    Last Post: 06-10-2013, 12:40 PM
  3. Replies: 15
    Last Post: 03-07-2013, 09:39 PM
  4. Replies: 6
    Last Post: 09-02-2012, 04:30 PM
  5. Form works, Subform gets error
    By jlclark4 in forum Forms
    Replies: 9
    Last Post: 01-03-2011, 09:24 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