G
Guest
I have a need to store a field in the database as
say 'D0001'.
Can someone please help me writing the code, I have
written the following and I am getting error (rightly) for
CAST, but I don't know what to use instead.
dim no as Integer
DoCmd.RunSQL ("select max(TEMP_NUM) into no from Prod_file where filing_area
= [FILING_AREA]")
[Temp_num] = no + 1
If [FILING_AREA] = "D" Then
[CONTRACT_NUM] = "D" + Right("00000000" + CAST(Temp_num, 8), 8)
End If
In this example it should appear something like 'D0000100'
'D0001001'
Thank you in advance!
-M
say 'D0001'.
Can someone please help me writing the code, I have
written the following and I am getting error (rightly) for
CAST, but I don't know what to use instead.
dim no as Integer
DoCmd.RunSQL ("select max(TEMP_NUM) into no from Prod_file where filing_area
= [FILING_AREA]")
[Temp_num] = no + 1
If [FILING_AREA] = "D" Then
[CONTRACT_NUM] = "D" + Right("00000000" + CAST(Temp_num, 8), 8)
End If
In this example it should appear something like 'D0000100'
'D0001001'
Thank you in advance!
-M