Tina,
For example, a user received 10 equipments, let say 10 mulitemeter, since
multimeter having the same model but different serial number, same product
code or invoice number but different serial number. it is not practical to
enter all these 10 multimeters when you received them in your warehouse.
the
best solution there is to create an append query in order to create 10
records of multimeter based on quantity received, then finally, you can
edit
each record by typing their own multimeter serial number, in that
scenario,
you saved time and effort.
i have a text box which user type quantity received and i have the commnad
button which accepts whatever the user type in numeric form, then it will
generate a series of numbers and product code:
let say, the user typed 10 numbers of multimeter that he/she received
(depends upon the order, if the order is 20, then it must generate 20 rows
so
on and so forth...)
ItemNo ProductCode InvoiceNumber SerialNo.
PartNumber
1 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
2 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
3 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
4 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
5 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
6 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
7 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
8 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
9 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
10 FLKMM220V INV09-00010
MM2500WCapacityUSMADE
You see the above scenario? it is not practical to enter all these
informations, what we are going to do is to build an append query that
genarate a series of numbers BASED ON QUANTITY THAT THEY RECEIVED.
Once they generate a series of records, then the user will finally
type/enter
unique serial number, so the user saved a lot of time in crunching /
entering
into the database.
------------------------------------------------------------------------------
-------------------------
Private Sub PostDetailsClick()
Dim LCntr As Integer
With quantity
LCntr = 1
Do Until LCntr = quantity + 1
LSQL = "INSERT INTO ImportLicense (ProductCode, invoicenumber,
airwaybillnumber, item_number)"
LSQL = LSQL & " values ("
'insert productcode, invoicenumber, companyname, airwaybill number etc
etc...
LSQL = LSQL & "'" & ProductCode & "', "& invoicenumber &" & LCntr &
")"
db.Execute LSQL
LCntr = LCntr + 1
Loop
Me.quantity.Locked = True
End With
Me.Requery
End Sub
------------------------------------------------------------------------------
------------
Tina,
LCntr is running, i don't have any problems with it, but the main problem
is
everytime i am trying to included fields say, "companyname" or
"invoicenumbernumber" etc etc., the query got stuck, what i want is i've
just
wanted to include some other fields asides from "prodcutcode".
thanks. robert
---------------------------------------------------------------------------
Private Sub PostDetailsClick()
Dim LCntr As Integer
With quantity
LCntr = 1
Do Until LCntr = quantity + 1
LSQL = "INSERT INTO ImportLicense (ProductCode, invoicenumber,
airwaybillnumber, item_number)"
LSQL = LSQL & " values ("
'insert productcode, invoicenumber, companyname, airwaybill number
etc
etc...
LSQL = LSQL & "'" & ProductCode & "', "& invoicenumber &" & LCntr &
")"
db.Execute LSQL
LCntr = LCntr + 1
Loop
Me.quantity.Locked = True
End With
Me.Requery
End Sub
i couldn't see any problem with the SQL statement itself, though of
course i
could have missed something. my next thought is the variable. LCntr is
[quoted text clipped - 11 lines]