Hello,
On my form, I designated the textboxes and comboboxes which the user has to fill in in order to save a record by making their back color yellow. In the on click event of the Save button, I want to check if any of the yellow controls are blank:
Note: the first If statement excludes 2 controls that should not be checked because they don't support either the back color property or the value property. When I try to hit save, I get error 438: object doesn't support this property or method. The line
is highlighted. All of the controls are either text boxes or comboboxes. I tried just the backcolor criteria in that line and that works. It has to be the value criteria. I also tried the following, none of which work:
if ctl.value= ""
if ctl= "'
if ctl.value= vbnullstring
if ctl= nullstring
if len(ctl.value)=0
Can anyone tell me why my textbox and combobox controls aren't supporting this property?
Thank you.
On my form, I designated the textboxes and comboboxes which the user has to fill in in order to save a record by making their back color yellow. In the on click event of the Save button, I want to check if any of the yellow controls are blank:
PHP:
Dim ctl As Control
For Each ctl In Me.Controls
If Not ctl.Name = "SaveInvoiceRecord_button" And Not ctl.Name = "Box95" Then
If ctl.BackColor = 10092543 And Len(ctl.Value < 1) Then
MsgBox "Please fill in all the required fields."
GoTo endsaving
End If
End If
Next ctl
Note: the first If statement excludes 2 controls that should not be checked because they don't support either the back color property or the value property. When I try to hit save, I get error 438: object doesn't support this property or method. The line
PHP:
If ctl.BackColor = 10092543 And Len(ctl.Value < 1) Then
if ctl.value= ""
if ctl= "'
if ctl.value= vbnullstring
if ctl= nullstring
if len(ctl.value)=0
Can anyone tell me why my textbox and combobox controls aren't supporting this property?
Thank you.