I'm stumped and not sure why this is happening. I have a time field from an AS400 table which comes in the format of 80000 for 8:00 a.m. and 130000 for 1:00 p.m.. I'm trying to do a simple conversion to make these numbers appears as a time. I have a function that should handle the conversion and it appears to run through fine but the time field shows up blank. My function is:
Function MkeTime
Dim db As Database
Dim rst As Recordset
Dim fld As Field
Dim f As Variant
Set db = CurrentDb()
If n < 99999 Then
f = Format(Left([n], 1) & ":" & Mid([n], 2, 2) & ":" & Right([n], 2))
n = f
Else
f = Format(Left([n], 2) & ":" & Mid([n], 3, 2) & ":" & Right([n], 2))
n = f
End If
End Function
I have also tried making a table and then converting the numbers into a new field and I get the same results. If anyone has any ideas I would appreciate any help. Thanks in advance.
Brad
Function MkeTime
Dim db As Database
Dim rst As Recordset
Dim fld As Field
Dim f As Variant
Set db = CurrentDb()
If n < 99999 Then
f = Format(Left([n], 1) & ":" & Mid([n], 2, 2) & ":" & Right([n], 2))
n = f
Else
f = Format(Left([n], 2) & ":" & Mid([n], 3, 2) & ":" & Right([n], 2))
n = f
End If
End Function
I have also tried making a table and then converting the numbers into a new field and I get the same results. If anyone has any ideas I would appreciate any help. Thanks in advance.
Brad