Results 1 to 2 of 2
  1. #1
    RayMilhon is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,067

    Pulling Data from a textbox on a Navigation subform

    I have a database I've built for one of our departments. I used the Navigation control in Access 2010 and it has 3 tabs. 1 for data entry, 1 for Reports and 1 for the Manager to be able to update a couple of lookup tables that populate a couple of combo boxes on the data entry form. The Reports form has 2 Text boxes for the user to enter the date range for the report. A listbox to select which report they want to run. And a command button to print preview the report. The Report RecordSource is a query the criteria for the report is: Between [Forms]![frm_MainMenu]![NavigationSubform].[form]![txtstart] and [Forms]![frm_MainMenu]![NavigationSubform].[form]![txtend].

    The report runs but no data displays I've verified that the field for that criteria does have a substantial # of Records between those 2 dates and there is no error just no data. I moved the criteria into 2 Columns just to be sure it was pulling the correct date range and both are blank. If I add the frm_Reports! between .[form]![txtend] So it looks like


    [Forms]![frm_mainmenu]![NavigationSubform].[form]!frm_Reports!txtend I get an error message

    what am I missing?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This has been the most aggravating 90 minutes I have ever had using Access. I tried to create a form with a Navigation control on it. I could have built most of a dB in that time.
    No wonder I never use the navigation control. What a royal pain in the neck....only 2 feet lower!! (I'm tall) I want to say all kinds of bad words and throw things!

    But back to the problem. Now that my BP is back down, this is the code I used to test the text boxes:
    Code:
    Private Sub btnOne_Click()
        MsgBox [Forms]![mainform]![NavigationSubform].[Form]!tbStart
        MsgBox [Forms]![mainform]![NavigationSubform].[Form]!tbEnd
    End Sub
    So I created a query that used a table with a couple of date fields. I pulled down a couple of date fields and added criteria to it. In the next blank column, I pasted in[Forms]![mainform]![NavigationSubform].[Form]!tbStart. In the next column I pasted in [Forms]![mainform]![NavigationSubform].[Form]!tbEnd.
    I had 2 records with dates that in the ranges. Here is the SQL
    Code:
    SELECT Calls.[Opened Date], Calls.[Due Date], [Forms]![mainform]![NavigationSubform].[Form]![tbStart] AS StartDt, [Forms]![mainform]![NavigationSubform].[Form]![tbEnd] AS EndDt
    FROM Calls
    WHERE (((Calls.[Opened Date])<=[Forms]![mainform]![NavigationSubform].[Form]![tbStart]) AND ((Calls.[Due Date])>[Forms]![mainform]![NavigationSubform].[Form]![tbEnd]));
    Then I switched the criteria to the BETWEEN criteria:
    Code:
    SELECT Calls.[Opened Date], Calls.[Due Date], [Forms]![mainform]![NavigationSubform].[Form]![tbStart] AS StartDt, [Forms]![mainform]![NavigationSubform].[Form]![tbEnd] AS EndDt
    FROM Calls
    WHERE (((Calls.[Due Date]) Between [Forms]![mainform]![NavigationSubform].[Form]![tbStart] And [Forms]![mainform]![NavigationSubform].[Form]![tbEnd]));
    Again I had 2 records.

    So everything seems to be working. Your path seems to be correct.
    Only thing left would be for you to post your dB.

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

Similar Threads

  1. Replies: 5
    Last Post: 04-30-2015, 01:50 AM
  2. Replies: 2
    Last Post: 04-20-2013, 03:37 AM
  3. Replies: 12
    Last Post: 12-06-2012, 05:36 PM
  4. Replies: 17
    Last Post: 02-08-2012, 10:06 AM
  5. Replies: 1
    Last Post: 05-29-2010, 02:39 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