Putting the same data on different field

rajput

Registered User.
Local time
Today, 23:25
Joined
Jan 11, 2001
Messages
39
Hi,

I have two fields for dates one has a simple format that is "050401" ofcourse 05 is the date 04 is month and 01 is the year and it is a Text Data Type. Now I have a second field (Date Data Type) that also takes number just like this however when tab is pressed I have it changed to "THURSDAY, April 05, 2001"

By the way I use this to print barcodes for the dates.

What I want to do is just punch the number in the first field and the other field gets the same data automatically. for now I have to write the same digits two times.

Thankx for the help.

Rajput

[This message has been edited by rajput (edited 04-05-2001).]
 
Hello. What you’re trying to do is fairly simple. For clarity I'll refer to the text field as Field1 and the date field as Field2. When using the code that follows, change them to the actual field names (of course). Code the following in Field1's 'AfterUpdate' event.


  • Me.Field2 = Me.Field1

Next, code Field2's 'AfterUpdate' event with the following.


  • Me.Field1 = Me.Field2

Now, when you type the date into either field it will automaticly update the other field. Good luck.

~Abby
 
Hi,
Thanks for the quick response. I tried that but I keep getting this run-time error saying the "The value you entered is'nt valid for this field". However when I did the vice-verse it works but it gives me in this format 05/Apr/2001 instead I want it to be in 050401 format.

Thanks
Rajput
 
Ah, ok. This should do it.
For Field1 'AfterUpdate'

  • Me.Field2 = CDate(Left(Me.Field1, 2) & "/" & Mid(Me.Field1, 3, 2) & "/" & Right(Me.Field1, 2))

For Field2 'AfterUpdate'

  • Me.Field1 = Format(Me.Field2, "ddmmyy")

Sorry any inconvenience.
~Abby
 

Users who are viewing this thread

Back
Top Bottom