Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking or Enabling Subforms

Status
Not open for further replies.

SDE1

Programmer
Mar 11, 2001
7
GB
I want to either lock or disable a subform based on the status of a combo box on the main form. This should occur on opening the form or changing the combo box's value. For example, if the combo box on the main form says "complete" then i wan to disable or lock all subforms appearing on the main form so they cannot be edited.

I have tried disabling: edits, additions and deletions but htis makes the data in the subform disappear which is undesirable.

I have tried declaring the subform as a form datatype then tried changing its properties based on the status (see below) of the main form's combo box but this does not work because (i think) a form does not have a locked property although a subform does. I do not know how to declare it as a subform though or if this would help:

eg of code used

If Status = "Complete" Then

Forms![mainform]![Subform].Form.Locked = true

End If

Any help is appreciated

Simon
 
thanks Lonnie.

you are quite right. I figured it out about 2 minutes after posting this thread. I was complicating things a bit much there for a while.

Thankyou

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top