Results 1 to 7 of 7
  1. #1
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93

    Navigation Form

    Hello everyone



    I have a Form that contains a command button and a text box. The command button is linked to a macro that prints a report. The report is built upon a query. The query uses a criteria that is linked to the text box inside the form. Everything worked fine, until I have moved the form to a Navigation Form. Now it seems that the query is not able to find the text box that contains the filter. Why is this happening ?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    The Navigation Control and the Wizard that uses the Navigation Control to create a Navigation Form have a specific purpose. The Navigation Control is best used when developing Microsoft Access Web Application that depend on SharePoint.

    I will be perfectly honest and tell you that I do not know exactly why your command button is no longer working. Certainly, the command button does not work because it was programmed to work in a collection of objects different than your Navigation Control. But the reasons the Navigation Control behaves the way it does are complex. Bottom line, I would be surprised to see an example of the Navigation Control customized in a way that managed half of the customizations capable of a subform control.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    In addition to what Itsme's posted, you may be able to get around this by having the control that contains the criteria actually be bound to a table and when the user updates the 'criteria' they are actually writing to a table then build the query driving your report based on the selected record in the table. This should avoid all the problem surrounding web forms and their inflexibility.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Did you moved the form to be a subform in another "navigation" form? If so you need to update your query criteria to point to the new location. When you are in that critera box in your query, right click and choose build, then Forms, then the Navigation form, then the subform and select the text box from the list of fields. The syntax will be displayed and you can hit OK for it to paste into your criteria box. It will be something like Forms![MainForm}![SubForm].TextBox

  5. #5
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    Thank you ItsMe, rpeare and Bulzie for you reply,

    Bulzie your absolutely right, I did move my Form as a subform into the navigation form, and all I needed to do is update the text box reference inside the query criteria I did as you said and it solved my problem.
    However, I have encountered another issue with another form that I moved inside the same navigation form (as a subform too). The form in question has a subform, the main form contains some text boxes that when the user types in, it fills a table and the subform has some other text boxes that when the user types in it fills another table that is related to the pervious table. After I moved the form inside the navigation form, when the user types in the main form and cursor leaves the main form and enters the subform, the data inside the main form gets committed to the table and all the text typed inside the text boxes gets cleared out and when the user try to type in text boxes inside the subform, He gets an error message “You cannot add or change a record because a related record is required in table Table1”

  6. #6
    SunTop is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Aug 2016
    Posts
    93
    Hello again,

    I did some more digging and I think I have narrowed the area that maybe causing the problem. I had an issue with the Tab order and thanks to rpeare it was resolved in following thread:

    https://www.accessforums.net/showthread.php?t=61891

    I tried removing these two lines:

    DoCmd.GoToRecord , , acNewRec
    DoCmd.GoToControl "compid"

    When I removed these two lines, the problem that I have described in the previous Post was resolved, but now the Tab order issue that I have described in the thread linked on this Post is “Unsolved”
    I hope this makes sense

  7. #7
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Since Location is required in form Accidents, put this in the AfterUpdate of the Location field:

    Forms![Accidents]![AccidentDetails Subform].Form![CompID].SetFocus

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

Similar Threads

  1. Replies: 3
    Last Post: 10-03-2022, 12:39 PM
  2. Replies: 2
    Last Post: 07-10-2016, 01:53 PM
  3. Replies: 5
    Last Post: 03-02-2015, 02:14 PM
  4. Replies: 5
    Last Post: 11-04-2014, 08:13 AM
  5. Replies: 12
    Last Post: 10-23-2014, 02:08 AM

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