Date problem

AndyShuter

Registered User.
Local time
Today, 14:58
Joined
Mar 3, 2003
Messages
151
I am trying to send data to a web form, but it wont accept it because the format is incorrect.

In my Access form, I have the format & input mask settings to Short Date, which produce a date as follows 09/01/2004
However, when I execute the following code...
...main.Document.Form(0).TextBox "YY", Year(Forms!frmFinanceProposal!Child851!!DateOf1stReg)

..the web form doesnt like it beacase it reqires the year as "04"

I cant change my input mask or format on my Access form, just wondered if there was a way of making "2004" be "04"

Thanks

Andy
 
You don't have to change the format of the textbox, you have to format the data you are sending. Using a format function only changes that instance of the data, not the data itself.

This code :
Function testmygrits()
Dim dteDate As Date
dteDate = #12/31/2005#
Debug.Print Format(dteDate, "YY")
Debug.Print dteDate

End Function

Produces:
05
12/31/2005
 

Users who are viewing this thread

Back
Top Bottom