After update for date field.

raghuprabhu

Registered User.
Local time
Yesterday, 19:55
Joined
Mar 24, 2008
Messages
154
I have a form with a date field and a transaction number field.


The transaction number is of the format 99678*06*10*01234. The first five digits (99678) are source code. The next two digits (06) are the register number. The next two digits (10) are the year the transaction was input. Finally the last five digits (01234) are the transaction number.

When I input the date I want the want the cursor to go to the transaction number field with the source code, register number and the year already input, rest in the 10th place.


I.e., if the input date is 24-June-10, the string 99678*06*10* should be input and the cursor should be resting in the 10th position. How do it do it?


I tried this.


Private Sub inputDate_AfterUpdate()
transNo.Value = "99678*06* &CInt(Format(inputDate(),'yy'))"
End Sub

Thanks
 
Try this:

Private Sub inputDate_AfterUpdate()
transNo.Value = "99678*06*" & Right(Year(Date), 2)
End Sub
 
Thanks

Working beautifully.

Cheers
 

Users who are viewing this thread

Back
Top Bottom