I have a part number generation system with several types of number all abbreviated, PRT short for parts, RAW short for RAW material and so on.. the numbers need to be unique something like PRT001, PRT002 or RAW001, RAW002 ext. ext. For this we will only use the RAW example
A table is used to generate the numbers [tbl_Raw_Num]. The table has 2 fields one an automatic number [ID] the other field is for the actual number entered [EnteredRawNumber]
To get the next availble number and enter it to the part number creation page
Dim RAW As String
RAW = "RAW00" & DMax("[ID]", "tbl_Raw_Num") + 1
Me.SCS_Part_Number.Value = RAW
Which works okay…. to write the entered value back to the table
DoCmd.RunSQL "INSERT INTO tbl_Raw_Num ([EnteredRawNumber])" & "VALUES('RAW')"
Which appears to work in VBA.. the ‘RAW’ variable shows the correct format RAW001 or RAW002… But when I look at the table itself the numeric values are missing, it only has the text IE RAW in every row…. The 001 or 002 ext. is missing
Any suggestions what’s causing the numeric values to disappear?