Loop to insert data from a form - Help

L

Les

Hi all, i have created the code below to loop through all the part numbers
intererd into txt_PrtNumber, this is working fine, but now i need to add the
part description as well, i am baffled here and do not know what to do.

Any help would be much appreciated.

Dim vPrtNums As String, lmyAdd As Variant
Dim MyNums As Variant, sPrtDescr As String, myDescr As Variant
Dim i, d
vPrtNums = frm_InputTM.txt_PrtNumber
i = Split(vPrtNums, ",")
MyNums = i
If frm_InputTM.Opt_SevPartsOneSupp = True Then

For Each i In MyNums
If i = "" Then


Else
With ActiveWorkbook.ActiveSheet
Range(vmyCol & vmyRow) = i
Range(vmyCol & vmyRow).Offset(0, 4) = sPrtDescr
Range(vmyCol & vmyRow).Offset(0, 5) = sModel
End With
End If
vmyRow = vmyRow + 1
Next
End If
 
W

WhytheQ

in your code you have this line:
vPrtNums = frm_InputTM.txt_PrtNumber

should you also have a line for the sPrtDescr variable?:
sPrtDescr = frm_InputTM.txt_PrtDescr

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top