By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,611 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,611 IT Pros & Developers. It's quick & easy.

What to enter in control source to show current data?

Daniel B
P: 33
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.
Jan 3 '12 #1
Share this Question
Share on Google+
8 Replies

Expert Mod 15k+
P: 31,712
=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.
Jan 3 '12 #2

Daniel B
P: 33
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.
Jan 3 '12 #3

Expert Mod 2.5K+
P: 2,545
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.

Jan 3 '12 #4

Expert Mod 15k+
P: 31,712
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.
Jan 3 '12 #5

Daniel B
P: 33
Here is the OnClick code that opens the report...

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdListActiveByTestStand_Click()
  2. On Error GoTo Err_cmdListActiveByTestStand_Click
  4.     Dim stDocName As String
  6.     stDocName = "rActiveEnginesByTestStand"
  7.     DoCmd.OpenReport stDocName, acPreview
  9. Exit_cmdListActiveByTestStand_Click:
  10.     Exit Sub
  12. Err_cmdListActiveByTestStand_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_cmdListActiveByTestStand_Click
  16. End Sub
Jan 3 '12 #6

Expert Mod 2.5K+
P: 2,545
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.

Jan 3 '12 #7

Expert Mod 15k+
P: 31,712
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?
Jan 3 '12 #8

P: 759
Try to use =Date() instead =Now()
Jan 4 '12 #9

Post your reply

Sign in to post your reply or Sign up for a free account.