M
Michael
I have the vb code below in my form.
On the form I have the date in a field called "Del"
I have a textbox called "LP" with the following in the default value
"=DateToChars(Date())"
I need to change this code from showing todays date to the date that is
stored in the "Del" field otherwise it will always show the current date and
not the date the product was received.
thank you
Michael
Public Function DateToChars(dtmDate As Date) As String
Dim astrCodes(9) As String
Dim strDate As String
Dim lngChar As Long
Dim strOutput As String
astrCodes(0) = "L"
astrCodes(1) = "A"
astrCodes(2) = "B"
astrCodes(3) = "C"
astrCodes(4) = "D"
astrCodes(5) = "E"
astrCodes(6) = "F"
astrCodes(7) = "G"
astrCodes(8) = "H"
astrCodes(9) = "I"
strDate = Format$(dtmDate, "ddmmyyyy")
For lngChar = 1 To Len(strDate)
strOutput = strOutput & astrCodes(Val(Mid$(strDate, lngChar, 1)) Mod
10)
Next lngChar
DateToChars = strOutput
End Function
On the form I have the date in a field called "Del"
I have a textbox called "LP" with the following in the default value
"=DateToChars(Date())"
I need to change this code from showing todays date to the date that is
stored in the "Del" field otherwise it will always show the current date and
not the date the product was received.
thank you
Michael
Public Function DateToChars(dtmDate As Date) As String
Dim astrCodes(9) As String
Dim strDate As String
Dim lngChar As Long
Dim strOutput As String
astrCodes(0) = "L"
astrCodes(1) = "A"
astrCodes(2) = "B"
astrCodes(3) = "C"
astrCodes(4) = "D"
astrCodes(5) = "E"
astrCodes(6) = "F"
astrCodes(7) = "G"
astrCodes(8) = "H"
astrCodes(9) = "I"
strDate = Format$(dtmDate, "ddmmyyyy")
For lngChar = 1 To Len(strDate)
strOutput = strOutput & astrCodes(Val(Mid$(strDate, lngChar, 1)) Mod
10)
Next lngChar
DateToChars = strOutput
End Function