Ok, one more question with this same type of function.
Using the above working code from Ajax works great for querying the table, but placing that same code into an INSERT INTO command from a save button causes an argument not optional error. I'm not sure what it is missing.
Also of note, I'm looping the code so I can create batches of serial numbers.
Thoughts? Ideas?
Code:
Private Sub cmdSave_Click() 'loop to save as many records as are listed in txtQuantity
For i = 1 To txtQuantity
'save data to table
CurrentDb.Execute "INSERT INTO [SerialTable](GregorianWeek, PartNumber, ITIWorkOrder, Serial) " & _
" VALUES('" & Me.txtGregorian & "','" & Me.cboPart & "','" & Me.txtWorkorder & "','" & Me.txtSerial = "18BA" & Nz(DMax("right([Serial],3)"), 0) + 1
Next i