What to enter in control source to show current data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel B
    New Member
    • Aug 2010
    • 33

    What to enter in control source to show current data?

    I have a report thats purpose is to display only current data. As of now the control source for the text box is... =Now() ...

    However, when the report is run it still brings up data that is not current. What can I enter in the control source for this text box to only display current data?

    Any help is much appreciated!

    Daniel B.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    =Now() will show the current date and time. If this is not what you're referring to when you say 'current data' then your question is very misleading as you fail even to introduce this concept in your question. To describe this omission as an oversight would be extreme understatement, even for the English.

    Comment

    • Daniel B
      New Member
      • Aug 2010
      • 33

      #3
      Okay, well instead of acting all superior do you have any other ideas of what my problem could be then, because for some reason noncurrent data still shows up in the report.

      Comment

      • Stewart Ross
        Recognized Expert Moderator Specialist
        • Feb 2008
        • 2545

        #4
        Daniel, instead of making remarks which might get your post deleted I'd suggest you post the on-click code which I presume is opening your report as it is impossible to tell what might or might not be going on without it. Presumably again the report is being opened with a filter based on your textbox value - but until we see the OpenReport statement we're just guessing.

        -Stewart

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32653

          #5
          Originally posted by Daniel
          Daniel:
          do you have any other ideas of what my problem could be then
          Absolutely. You haven't included enough information when posting your question. Quite an obvious, and easily avoided, problem I should think. When you've rectified that (I assume you realise that's not something we can really do for you) then we can start to help.

          Comment

          • Daniel B
            New Member
            • Aug 2010
            • 33

            #6
            Here is the OnClick code that opens the report...

            Code:
            Private Sub cmdListActiveByTestStand_Click()
            On Error GoTo Err_cmdListActiveByTestStand_Click
            
                Dim stDocName As String
            
                stDocName = "rActiveEnginesByTestStand"
                DoCmd.OpenReport stDocName, acPreview
            
            Exit_cmdListActiveByTestStand_Click:
                Exit Sub
            
            Err_cmdListActiveByTestStand_Click:
                MsgBox Err.Description
                Resume Exit_cmdListActiveByTestStand_Click
                
            End Sub

            Comment

            • Stewart Ross
              Recognized Expert Moderator Specialist
              • Feb 2008
              • 2545

              #7
              OK, what you have posted shows that the report is opened with no filter applied from the OpenReport method. This means one of two things: either the query underlying the report has a Where clause which refers to the textbox you mention in post #1, or there is no filter being applied to the report at all.

              Please post the SQL for the query underlying your report, which should clear up the issue of whether or not there is any actual filtration being applied.

              -Stewart

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32653

                #8
                OK. In no way does your code explain what you mean when you use a term like 'current data' in your question. Nor does it explain what the control referred to in your question simply as 'the text box' is supposed to be doing for you. I would guess that it may be an attempt at filtering, but as Stewart points out, the code you've shown doesn't support that idea. Why not actually ask the question sensibly, providing the information that is necessary for it to make sense?

                Comment

                • Mihail
                  Contributor
                  • Apr 2011
                  • 759

                  #9
                  Try to use =Date() instead =Now()

                  Comment

                  Working...