Hello there
I have a mainform with a subform.
I would like to prevent users from entering data into the subform before they enter data into the mainform (mainform fields must be completed first!).
Let's say the main form is called "FormA" and the subform is called "SubFormB".
How can I achieve that?
So I have tried it with the following code but it is not working.
_________
Dim i as Integer
Dim blnLock as Boolean
'
blnLock = False
For i = 0 to Me.Controls.Count -1
Select case Me.Controls(i).ControlType
Case acLabel, acSubForm, acCommandButton
' do Nothing
Case Else
If IsNull(Me.Controls(i).Value) Then
blnLock = True
i = Me.Controls.Count
end if
End Select
Next i
Me.SubFormControlName.Locked = blnLock
______________
Any help is very much appreciated.
Thanks very much.
Stefan
I have a mainform with a subform.
I would like to prevent users from entering data into the subform before they enter data into the mainform (mainform fields must be completed first!).
Let's say the main form is called "FormA" and the subform is called "SubFormB".
How can I achieve that?
So I have tried it with the following code but it is not working.
_________
Dim i as Integer
Dim blnLock as Boolean
'
blnLock = False
For i = 0 to Me.Controls.Count -1
Select case Me.Controls(i).ControlType
Case acLabel, acSubForm, acCommandButton
' do Nothing
Case Else
If IsNull(Me.Controls(i).Value) Then
blnLock = True
i = Me.Controls.Count
end if
End Select
Next i
Me.SubFormControlName.Locked = blnLock
______________
Any help is very much appreciated.
Thanks very much.
Stefan