ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,732
- Office Version
- 2007
- Platform
- Windows
I have the following code in a module.
All the above entries from my worksheet to userform are correct APART from TextBox9
In TextBox9 the value has been taken from worksheet column X which is incorrect as it should be taking the value from column AB
My issue is looking at all the code for hours i just cant see or find what tells the userform fields where to get data from to populate them.
Ive looked for at least 2 hours this morning.
Does the code above advise you of anything thanks.
Something is happening as TextBox9 is being populate but trying to locate what is telling it to look at column what column
Rich (BB code):
Option Base 1
Function ControlNames() As Variant
ControlNames = Array("txtCustomer", "txtRegistrationNumber", "txtBlankUsed", "txtVehicle", _
"txtButtons", "txtKeySupplied", "txtTransponderChip", "txtJobAction", _
"txtProgrammerCloner", "txtKeyCode", "txtBiting", "txtChassisNumber", _
"txtJobDate", "txtVehicleYear", "txtPaid", "txtInvoiceNumber", "TextBox1", _
"TextBox2", "TextBox3", "TextBox4", "TextBox5", "TextBox6", "TextBox7", "TextBox9", "txtPinCode")
End Function
Function IsComplete(ByVal Form As Object) As Boolean
Dim i As Integer
For i = 1 To UBound(ControlNames)
IsComplete = CBool(Len(Form.Controls(ControlNames(i)).Text) > 0)
If Not IsComplete Then
MsgBox "PLEASE COMPLETE ALL FIELDS", 17, "Entry Required"
Form.Controls(ControlNames(i)).BackColor = vbMagenta
Form.Controls(ControlNames(i)).SetFocus
Exit Function
End If
Next i
End Function
All the above entries from my worksheet to userform are correct APART from TextBox9
In TextBox9 the value has been taken from worksheet column X which is incorrect as it should be taking the value from column AB
My issue is looking at all the code for hours i just cant see or find what tells the userform fields where to get data from to populate them.
Ive looked for at least 2 hours this morning.
Does the code above advise you of anything thanks.
Something is happening as TextBox9 is being populate but trying to locate what is telling it to look at column what column