how to do a bulk submit?

  • Thread starter Thread starter Daniel M
  • Start date Start date
D

Daniel M

I have a database where i submit form data based on a serial number selected
from a dropdown menu. I would like to be able to do this by scanning in the
serial numbers into a list box. Can anyone give me some pointers on how to
accomplish this?

- Scan in serial numbers into list box. Serial number format is 02-123456.
Scanned data will be "02-12345602-65432102-321654"

- break up the data into induvidual serial numbers.

- Submit the data one serial number at a time.

Thanks.
 
Hi Daniel,

I use combo boxes for virtually everything related to pick lists. I hate listboxes but okay, if you insist...

In the code below - strSerial is the string of data you pass to the procedure.
The procedure assumes the name of the list box is lstSerial and name of the form is frmTest. You will need to edit those to match your object names.

You might prefer to change the procedure into a function; assigning the value of s to the function, instead of directly stamping these values into the listbox.

Hope this helps...
Gordon


Public Sub SerialList(strSerial As String)

Dim s As String 'holds list row source
Dim i As Integer 'loop counter

strSerial = Trim(strSerial)

If ((Len(strSerial) Mod 9) > 0) Or (Len(strSerial) = 0) Then
MsgBox "Sorry, cannot use the serial data provided: " & strSerial, vbCritical, "Bad Scan Value"
Exit Sub
Else
For i = 1 To (Len(strSerial) - 8) Step 9
s = s & Chr(34) & Mid(strSerial, i, 9) & Chr(34) & Chr(59) 'double-quotes & semi-colon
Next i
s = Left(s, Len(s) - 1)
End If

Forms!frmTEST!lstSerial.RowSourceType = "Value List"
Forms!frmTEST!lstSerial.RowSource = s
'Debug.Print s uncomment for testing if needed
End Sub
 
Actually i miss spoke or typed. the data will be scanned in so it will be
scanned into a text box. it will need to be parsed out from there.
 
Back
Top