The leading zero is dropped during this append query
Table named Calc exists with Text fields: Serial and Julian.
The Code:
Dim strJulain as string
strJulian = Right(year(date), 1) & DatePart("y", date())
DoCmd.RunSQL "INSERT INTO Calc(Serial, Julian) VALUES(tboSerial, " & strJulian & ")"
I tried to insert a line before the DoCmd like
strJulain=Format(strJulain, "0000")
or
strJulian=CStr(strJulain)
without any luck.
Using a breakpoint and stepping through shows a value of "0100" for strJuliain but 100 is shown in the table for Julian. The Serial field retains leading zeros retrieved from a form's textbox.
Any ideas?
Table named Calc exists with Text fields: Serial and Julian.
The Code:
Dim strJulain as string
strJulian = Right(year(date), 1) & DatePart("y", date())
DoCmd.RunSQL "INSERT INTO Calc(Serial, Julian) VALUES(tboSerial, " & strJulian & ")"
I tried to insert a line before the DoCmd like
strJulain=Format(strJulain, "0000")
or
strJulian=CStr(strJulain)
without any luck.
Using a breakpoint and stepping through shows a value of "0100" for strJuliain but 100 is shown in the table for Julian. The Serial field retains leading zeros retrieved from a form's textbox.
Any ideas?