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!

Inserting date when printed

Status
Not open for further replies.

Walshie1987

Technical User
Oct 5, 2006
100
Hi, I have a db which is working fine, but now, when i press the "Print Order" button I want the date that the order was printed to be inserted into my "Order Printed" text box.

ie./ When I click the print order button, todays date is transferred into my "Order Printed" text box, so if the orders status is unknown i can say "Well he order was printed on 08-Mar-07 date"

Cheers
Chris
 
Got that sorted, by using the following code:

Dim OrderPrinted as string
OrderPrinted = Now()
txtDatePrinted = OrderPrinted

but the date is shown as a long date (08/03/2007 12:47:42)

How can i change this just to read 08/03/07??
 

I'm confused! Why

Code:
Dim OrderPrinted as string
OrderPrinted = Now()
txtDatePrinted = OrderPrinted

instead of simply

Code:
txtDatePrinted = Now()

In answer to your question

txtDatePrinted = Format(Now(),"dd/mm/yy") will yield 08/03/07

Since you list the date as 08/03/07 I assume you're not using a PC with the US as the country setting. You may have to swap the mm and dd around if you're using another country setting, but try my original code first.

Good luck!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Thanks, don't know why i did it the long way round! I Can't have been thinking straight yesterday.

Thanks for the reply, everything works fine now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top