Easy date entry

mu

Registered User.
Local time
Today, 04:47
Joined
May 22, 2002
Messages
18
Hi everyone

I dont know if this is possible or whether I have missed something very obvious but what I would like to do is this:

I have a date entry form for posting invoices, in order to speed up data entry I would like to be able to just enter the invoice date eg 5 and then when leaving the field get access to automatically change the invoice date to 05/10/02.
Sometimes invoices maybe from an earlier month and so it would still need to work as it does at the moment where by when I enter 23/9 or preferably 239 it returns 23/09/02

also is it possible when first entering the date field to change the default date (created by autofillnewrecord mod) using the up and down arrows again helping to speed up data entry.

I've searched the forum and cant find anything like this which is why I'm wondering whether I've missed something obvious

Hope someone can help, thanks in advance

MU
 
If you can´t use some format to achieve this, you´ll probably need to do some string manipulation.

provided you want to enter 220202 for the 22nd of february 2002:

as an after_update event (of your date field)

dim strday as string
dim strmonth as string
dim stryear as string

strday = left(Me.yourdatefield, 2)
strmonth = mid(Me.yourdatefield,3,2)
stryear = right(Me.yourdatefield,2)

Me.yourdatefield = strday & "/" & strmonth & "/" & stryear

If you want to be able just to put "5" for the 5th of this month, but by putting "52" enter the 5th of february, the problem will probably be to think out a system so that the users never enter ambigous dates (for instance what date is "12")

However, you might be able to figure something out by checking the number of digits entered or something like that. I think you use the Len() function for that.

Hope this helps. Maybe I put something wrong in the syntax ( I usually do), but check out the Mid, right, left and Len functions.

Fuga.
 
If you have three separate controls for day, month and year, you could default the month and year to the current month, and concatenate the three controls to give the date you want. This does not match what you asked, but it kind of sidles up to it!

For the Month and Year controls, you could use list boxes to give some cursor selection.
 
Thanks for your responses guys and I will give your ideas a shot.

With my limited ( but constantly improving ) VB knowledge I think I may be able to get something like what I want, if however anyone has something similar already working I would really appreciate some guidance as to the best way to set such a module up.

Thanks again

MU
 

Users who are viewing this thread

Back
Top Bottom