Results 1 to 12 of 12
  1. #1
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58

    Question Report needs to reflect date on sub-navigation form

    Hello all

    I have a navigation form (frmMain) which has two buttons navBtn1 and navBtn2. Each button when clicked leads to another navigation form, with more buttons. That is the basic structural outline.

    Say, navBtn1 opens a form 'frmAdmin'. I have two text boxes txtStartDate and txtEndDate on the frmAdmin. I have numerous reports on the same form which run for the selected date ranges. Now I am trying to give the path for the date fields on my report as

    =[Forms]![frmMain]![navBtn1]![frmAdmin].[txtStartDate]



    It returns an error. What is going wrong here? Can someone please help?

    Appreciate your thoughts and suggestions.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    (Between) or = or > or whatever

    Forms!frmAdmin!txtStartDate

  3. #3
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58
    I already tried that. That works only when I have the frmAdmin open directly; but not when I have it open through the navigation button!

    I am sure I should have the frmMain in the path as it navigates to the frmAdmin from the frmMain. I just cant figure out the correct path :X

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The form needs to be open. Or put the dates on the main form as hidden fields. They need to be somewhere for the report to see them. The buttons are just controls on a form, not forms themselves, so cannot be referenced.

  5. #5
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You're right, I misunderstood! Sorry.

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This is why I do this - to learn new stuff!

    Here is the layout
    Format([forms]![NavFrm1]![NavigationSubform]![StartDate],"mm/dd/yyyy")

    Notes:
    1) I tried it in a query and it gave me garbage, hence the "Format" statement. I don't know whether you need it or not
    2) NavFrm1 is the name of the navigation form
    3) NavigationSubform is the name of the (frmAdmin) that I put on the nav form

  7. #7
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58
    What you have is what I alrady had

    You are not wrong in what you said. Its only that, I have a navigationform under the main navigation form (which I believe is NavFrm1 in the example u gave) instead of a regular form. And I need to reference that. But thanks for the input.. I will keep working on it.

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What I gave you was correct - all you need to do is reference the name on the nav form instead of frmAdmin.

    In case you don't know how to find out what it is:
    - go to the nav form
    - right-click, go into design view
    - click on the frmAdmin
    - show the properties - the first property is "Name" - that is the name you must use as the second form name, in my example NavigationSubform, instead of frmAdmin

  9. #9
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58

    Exclamation ->Tryin to explain better

    Ok. looks like I was a bit vague. Please look into the attachments below to get a better idea of what I am trying to get.

    The OldForm image shows that I have one navigation form with a lot of buttons. Each button has its own form on which I have the date ranges and based on which some reports are run. Now I keep adding more forms everyday, which is making my navigation form clogged with buttons. So I resorted to putting a few of those buttons into a new navigation form, and set the first button on the old navigation form to open the new navigation form (sorry if its confusing.. bt thats the best i could explain). Eventually, I have only two buttons on the old form, making it look better. Now when i get to the new navigation form (pls refer second image 'NewForm'), all the buttons on the old form are listed as vertical tabs in the new form. Each of this tabs opens its own form just like in the old form. But I am not able to give correct reference to the dates.

  10. #10
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    We are rather going around in circles! All that is happening is that the form names are not right. Here is a trick I found to get the right form names in the right sequence.

    Go into query design, select any table, select any field
    In the criteria line, type in "Forms!"
    A list of form names will appear, select the only you want
    type another "!", a list of subform names will appear based on the first form name you selected
    etc

    This way you will get the correct form names in the correct order - the last one will have your dates on it. And now you will know how to reference them in your report

  11. #11
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    When referencing a subform you need to use the name of the subform control (control on the parent form which HOUSES the subform) and NOT the name of the subform itself unless it is the exact same name as the subform control.

    So you would have

    =[Forms]![FormNameHere]![SubFormControlNameHere].[Form]![ControlNameHere]

    And the .Form part is necessary exactly as shown (unless the subform control and subform are named exactly the same).

    You might want to check these two articles out (from my website):
    http://www.btabdevelopment.com/ts/ewtrhtrts

    http://www.btabdevelopment.com/ts/refer2sfrms

  12. #12
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58

    Talking I finally figured it out!!!!

    Aytee.. Thanks for all your thoughts.

    Bob,

    I was trying to reference another navigation form under the main navigation form.. and so it was a little different from referencing just one subform (which I have done previously.. successfully ). Apparently, it is more like a subform under a subform. I realized that after going through your website. This is what I have finally:

    =[Forms]![frmMain]![NavigationSubform].[Form]![NavigationSubform].[Form].[txtStartDate]

    And now its working Thanks a ton. Because of this, I can use sub-navigation forms, which makes my application look far less congested now.

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

Similar Threads

  1. Printing a report in a navigation form
    By DanKoz in forum Forms
    Replies: 2
    Last Post: 08-29-2011, 12:11 PM
  2. Replies: 4
    Last Post: 07-17-2011, 06:07 PM
  3. Replies: 3
    Last Post: 11-16-2010, 10:08 AM
  4. Report does not reflect database view
    By ErinHayes in forum Reports
    Replies: 5
    Last Post: 09-27-2010, 07:32 PM
  5. Can't reflect changes table-forms
    By graciemora in forum Forms
    Replies: 10
    Last Post: 06-27-2010, 03:03 PM

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