instanceoftime
Board Regular
- Joined
- Mar 23, 2011
- Messages
- 102
I am using a scan gun to enter info (which is why I am using 3 forms since the click event only works for the first command box) (and don't want message boxes)
anyhow all the infor is in an array and I am trying to write back to form1(frmPricer) how can I do that?
anyhow all the infor is in an array and I am trying to write back to form1(frmPricer) how can I do that?
Code:
Private Sub cmdEnter_Click()
Dim str7 As String, str8 As String, str9 As String, str10 As String, str11 As String, str12 As String
Dim NotFound As Integer
Dim arr As Variant
Dim I As Long
Dim Price As Currency
NotFound = 0
ActiveWorkbook.Sheets("Items").Activate
Price = txtbxPrice.Text
If Price <> False Then
With ActiveSheet
arr = .Range("A1:H" & .Cells(.Rows.Count, "A").End(xlUp).Row)
End With
For I = 1 To UBound(arr)
If arr(I, 7) = UPCNumber Then
str7 = IIf(str7 = "", arr(I, 1), str7 & "|" & arr(I, 1))
str8 = IIf(str8 = "", arr(I, 2), str8 & "|" & arr(I, 2))
str9 = IIf(str9 = "", arr(I, 3), str9 & "|" & arr(I, 3))
str10 = IIf(str10 = "", arr(I, 4), str10 & "|" & arr(I, 4))
str11 = IIf(str11 = "", arr(I, 7), str11 & "|" & arr(I, 7))
str12 = IIf(str12 = "", arr(I, 8), str12 & "|" & arr(I, 8))
Cells(I, 8).Value = (Price)
[COLOR=#ff0000] frmPricer.lbxItemNumber.List = Split(str7, "|") [/COLOR]
[COLOR=#ff0000] frmPricer.lbxDescription.List = Split(str8, "|")[/COLOR]
[COLOR=#ff0000] frmPricer.lbxCost.List = Split(str9, "|")[/COLOR]
[COLOR=#ff0000] frmPricer.lbxDate.List = Split(str10, "|")[/COLOR]
[COLOR=#ff0000] frmPricer.lbxUPCNumber.AddItem (Response2)[/COLOR]
[COLOR=#ff0000] frmPricer.lbxPrice.AddItem (Price)[/COLOR]
Unload Me
Unload frmAddUPC
End If
Next
End If
End Sub