Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with date and time formatting on reports

Status
Not open for further replies.

Inky2201

Technical User
Jan 15, 2005
26
GB
Hello,
I have a problem with entering the date and time on a report tidily. At present I have 2 text boxes, one for date and one for time with an "at" in another text box in the middle e.g. [26th July 2005] [at] [9.30PM].
When I use this method the first text box has to be large enough to accept December so if the date is May it leaves a large gap and I am trying to find a way over this.
I have tried putting both together in a string e.g.
[Date]&" at "&[Time] which works but then I cannot format the date and time to Long Date and Medium Time.
Is there an easy way over this?
Hope to hear from you avids out there.
regards
I
 

Hi,

Use the Format function...
Code:
Format([Date],"dd mmm yyyy")&" at "&Format([Time],"hh:nn AM")


Skip,
[sub]
[glasses] [red]Be advised:[/red]We know Newton's 3 Laws. But did you hear about the [red]FOURTH???[/red]
Only ONE fig per cookie![tongue][/sub]
 
This is the Access Modules/VBA Coding forum, for report qestions, try the reports forum (forum703)

Another non code suggestion for this report control question, is using =now() as controlsource, then use the format property of the control

[tt]dd mmmm yyyy" at "hh:nn AMPM[/tt]

Roy-Vidar
 
Thanks both of you,
I think Skips idea is more appropriate as the date and time will not be todays but a booked date and time for the future.
But both are worthwhile - thanks
I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top