mdschuetz
Nerd Incognito
- Local time
- Today, 15:26
- Joined
- Oct 31, 2007
- Messages
- 49
I am trying to use an input box value as a parameter to return values, it is comming back blank. If I remove the input box related code, it returns all values, so there must be an error with the input box coding. Can someone help me identify it?
Code:
Private Sub cmdQC9_Click()
[COLOR="Red"]Dim strINP As String
strINP = InputBox("Enter Invoice Number", "Invoice Number")[/COLOR]
Dim objXxL As Excel.Application
Dim objWxB As Excel.Workbook
Dim objWxS As Excel.Worksheet
Set objXxL = Excel.Application
Set objWxB = objXxL.Workbooks.Open("\\mypath.xls")
Set objWxS = objWxB.Worksheets("Form")
With objWxS
.Cells(6, 3).Value = Me.txtTD
.Cells(13, 13).Value = Me.txtYes
.Cells(13, 16).Value = Me.txtNo
.Cells(10, 4).Value = Me.PurchaseOrderNumber
.Cells(8, 3).Value = Me.cboSupplierID.Column(1)
.Cells(8, 19).Value = Me.cboAccount.Column(1)
.Cells(10, 9).Value = Me.cboPJO.Column(1)
.Cells(13, 31).Value = Me.cboInspect.Column(0)
Dim xx As Integer
xx = 18
[Purchase Orders Subform].Form.Recordset.MoveFirst
While Not [Purchase Orders Subform].Form.Recordset.EOF
Dim strIDD As String
[COLOR="Red"]Dim strINV As String
strINV = Me.[Purchase Orders Subform].Controls("Invoice").Value[/COLOR]
strIDD = Me.[Purchase Orders Subform].Controls("UnitsReceived").Value
[COLOR="red"]If strINV = strINP & strIDD > 0 Then[/COLOR]
.Cells(xx, 5).Value = [Purchase Orders Subform].Form!UnitsReceived
.Cells(xx, 31).Value = [Purchase Orders Subform].Form!UnitsReceived
.Cells(xx, 8).Value = [Purchase Orders Subform].Form!ItemDescription
.Cells(xx, 26).Value = [Purchase Orders Subform].Form!PartNumber
.Cells(xx, 6).Value = [Purchase Orders Subform].Form!txtUD
[COLOR="red"]End If[/COLOR]
[Purchase Orders Subform].Form.Recordset.MoveNext
xx = xx + 1
Wend
End With
objXxL.Visible = True
End Sub