sanders720
Programmer
I am trying to populate the same way with a variable, and it can't find the object...
B1(q).Value = "2"
This happens with either .Value or .Text... The B1(q) evaluates properly... Thanks in advance for any help you can provide...
Private Sub BUILDQUERY2()
Dim c As Integer
Dim q As Integer
B1 = Array("txtITJobNo", "txtVendor", "txtInvoiceNo", "txtRequestingUser", "txtAuthorizingUser", "txtPurchaseDate", _
"txtWarrantyDate", "txtManufacturer", "txtName", "txtPartNo", "txtSerialNo", "txtCDKey", _
"txtUpgrade", "txtQuantity", "txtSeats", "txtUser", "txtInstalledPC", "txtLicense", _
"txtPurchasedPrice"
For q = 1 To 19
If B(q) <> "" And B1(q) <> "2" Then
c = c + 1
If Len(OBJECT2) > 0 Then
OBJECT2 = OBJECT2 & " and (" & A(q) & "= '" & B(q) & "'.Text)"
Else
OBJECT2 = "(" & A(q) & "= '" & B(q) & "'.Text)"
End If
Debug.Print OBJECT2
B1(q).Value = "2"
B(q).Enabled = False
End If
Next q
End Sub
B1(q).Value = "2"
This happens with either .Value or .Text... The B1(q) evaluates properly... Thanks in advance for any help you can provide...
Private Sub BUILDQUERY2()
Dim c As Integer
Dim q As Integer
B1 = Array("txtITJobNo", "txtVendor", "txtInvoiceNo", "txtRequestingUser", "txtAuthorizingUser", "txtPurchaseDate", _
"txtWarrantyDate", "txtManufacturer", "txtName", "txtPartNo", "txtSerialNo", "txtCDKey", _
"txtUpgrade", "txtQuantity", "txtSeats", "txtUser", "txtInstalledPC", "txtLicense", _
"txtPurchasedPrice"
For q = 1 To 19
If B(q) <> "" And B1(q) <> "2" Then
c = c + 1
If Len(OBJECT2) > 0 Then
OBJECT2 = OBJECT2 & " and (" & A(q) & "= '" & B(q) & "'.Text)"
Else
OBJECT2 = "(" & A(q) & "= '" & B(q) & "'.Text)"
End If
Debug.Print OBJECT2
B1(q).Value = "2"
B(q).Enabled = False
End If
Next q
End Sub