Question Why Date works in one report but not another

Stoss

Registered User.
Local time
Today, 11:47
Joined
Nov 5, 2010
Messages
107
I have two reports that are fairly similar. In both I used

Me!txtMyCaption = strLocation & "'s " & "Priority Report as of " & Date
(same name in both reports)


It works fine in one report but not the other. In the one that doesn't work, it prints all the text you see above except the date. I am setting this on the Activate Event in both.

Now() works fine in both

Confused,
-Stoss
 
I normally get an error if *any* part of a text box fails - any chance that it's as simple as not enough room in the box to display the date?
 
Also try one of three things, in order of preference:

1. Use the Load event instead of the Activate event

OR

2. Me!txtMyCaption = strLocation & "'s " & "Priority Report as of " & VBA.Date

OR

3. Me!txtMyCaption = strLocation & "'s " & "Priority Report as of " & DateValue(Now())
 
seems simple but its DATE() or NOW() - you are bracketing both right ?
 
The brackets are optional in VBA.
Optional if you use VBA.Date, but if you just use DATE it will strip them even if you include them. (and they are parentheses not brackets - there is a difference :D )
 
Yep, that's right, which is why I mentioned about it being optional. Whether you put it or not, it will strip it off. It's still a good habit to put them.
 

Users who are viewing this thread

Back
Top Bottom