Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2008, 07:41 AM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default CHANGE DATE FORMAT

HI AGAIN,

1) I HAVE A TEXT BOX AND I'D LIKE TO TAKE VALUE OF THE DATE
E.G. 25/04/2008 TO 20080425 (YEARMONTHDAY)
2) WHEN I TAKE THE VALUE FOR EVERY ROW I WANT TO TAKE A NUMBER BESIDE AUTOMATIC
E.G. 200804251, FOR THE FIRST ROW
     200804252, FOR THE SECOND ROW
     200804253, ..................

 
Old April 7th, 2008, 09:31 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

For item 1, I would have a date field and keep the date in it in the proper format, then I would have a text field that you take from the date field like this:

Dim sDate As String
Dim dtDate As Date

dtDate = Me.DateField

sDate = DatePart("yyyy", dtDate) & DatePart("mm", dtDate) & DatePart("d", dtDate)

Me.StringDateField = sDate

For the second item, store the string date, and then add another column that is a number value, and just take the Max of the number culumn where Date = sDate and add 1.

Did that help?

mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old April 8th, 2008, 12:16 PM
Authorized User
Points: 250, Level: 4
Points: 250, Level: 4 Points: 250, Level: 4 Points: 250, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: , , Greece.
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

THANX A LOT THATS IT





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change default date parameter format JeffHickman Reporting Services 0 February 14th, 2006 06:52 AM
how to change date format prasannagps Forum and Wrox.com Feedback 2 September 14th, 2005 01:28 PM
need to change date format desprate Access VBA 1 April 10th, 2005 12:45 PM
Change date format Patrick19 Classic ASP Basics 1 March 14th, 2005 06:23 PM
date format change yuvalk SQL Server DTS 2 March 29th, 2004 05:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.