Locking a control

Fekla

Registered User.
Local time
Yesterday, 20:54
Joined
Jan 7, 2007
Messages
22
Good afternoon.

I have a form with a subform.
I have problems writing the following code:
if there are some records in the subform, lock the control in the main form.

E.G.
you can only change combo box Customer if he has placed no Orders (all the details of the orders are in the subform). plus, if there were orders, but the user deleted them.

i guess i am stuck with selecting the condition in the if-statement correctly. can anyone advise me?

thx
 
What have you tried so far? You can look at the RecordCount of the SubForm and if 0 then lock your ComboBox in the Current event of the MainForm.
 
to tell you the truth, i dont know the correct syntax.

if frmSub.RecordCount=0 Then
Me.cboCustomer.Locked=True
End If

???
 

Users who are viewing this thread

Back
Top Bottom