T
Tammy F
I would like the user to enter a number between 1 and 26 - to create a
numbered list of records for them, so all they have to do is type the pallet
number. Here is my code:
Dim positionlines, totallines, shpmntid As Integer
Dim dnmbr As String
positionlines = Forms!frm_Shipment_Entry!positionlinedefault
totallines = 0
dnmbr = Forms!frm_Shipment_Entry!Dienumberdefault
shpmntid = Forms!frm_Shipment_Entry!ShipmentID
Do
Do While totallines < positionlines ' Inner loop.
totallines = totallines + 1
strSQL = "Insert Into Tbl_Shipments_Dies ( ShipmentID, DieNumber,
PositionNumber )values(" & Chr$(34) & shpmntid & Chr$(34) & ", " & Chr$(34) &
dnmbr & Chr$(34) & ", " & Chr$(34) & totallines & Chr$(34) & ")"
CurrentDb.Execute strSQL
If totallines >= positionlines Then
Exit Do
End If
Loop
Loop Until totallines = positionlines
What did I do wrong that it doesn't exit the loop when the totallines =
positionlines?
Thanks,
Tammy
numbered list of records for them, so all they have to do is type the pallet
number. Here is my code:
Dim positionlines, totallines, shpmntid As Integer
Dim dnmbr As String
positionlines = Forms!frm_Shipment_Entry!positionlinedefault
totallines = 0
dnmbr = Forms!frm_Shipment_Entry!Dienumberdefault
shpmntid = Forms!frm_Shipment_Entry!ShipmentID
Do
Do While totallines < positionlines ' Inner loop.
totallines = totallines + 1
strSQL = "Insert Into Tbl_Shipments_Dies ( ShipmentID, DieNumber,
PositionNumber )values(" & Chr$(34) & shpmntid & Chr$(34) & ", " & Chr$(34) &
dnmbr & Chr$(34) & ", " & Chr$(34) & totallines & Chr$(34) & ")"
CurrentDb.Execute strSQL
If totallines >= positionlines Then
Exit Do
End If
Loop
Loop Until totallines = positionlines
What did I do wrong that it doesn't exit the loop when the totallines =
positionlines?
Thanks,
Tammy