Edit Subform Properties From Main form

fluid

Registered User.
Local time
Today, 08:57
Joined
Nov 27, 2008
Messages
81
Hi,

I want to edit the "Allowedits" property in my subform with code based on a iif statement in my main form code.

What I want to do is...based on my IIf statement, make both the form and subform Read-Only.


Here is the code I have, It will make my main form read-only, but not my subform. No errors, just doesn't make it Read-Only


If [Recieved] = False Then
Form.AllowEdits = false

Me.[mysubform].allowedits = False
Else
Form.AllowEdits = True
Me.[mysubform].allowedits = True
End If
 
Hi,

I want to edit the "Allowedits" property in my subform with code based on a iif statement in my main form code.

What I want to do is...based on my IIf statement, make both the form and subform Read-Only.


Here is the code I have, It will make my main form read-only, but not my subform. No errors, just doesn't make it Read-Only


If [Recieved] = False Then
Form.AllowEdits = false

Me.[mysubform].allowedits = False
Else
Form.AllowEdits = True
Me.[mysubform].allowedits = True
End If

Hello Fluid,

I believe you need to reference your subform properly to get your code to work so try changing to this:

If [Recieved] = False Then
Form.AllowEdits = false
Me.[mysubform].Form.Allowedits = False
Else
Form.AllowEdits = True
Me.[mysubform].Form.Allowedits = True
End If

HTH,
Shane
 
Ah yes...you are very correct.

Thank-you.
 

Users who are viewing this thread

Back
Top Bottom