Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2006

Tip: Looking for answers? Try searching our database.

How To make a subform uneditable/editable.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bbrazeau - 25 Feb 2006 14:42 GMT
My question is: I have a form (form1) which has a field that is a look up
wizard to another form (form2). Table normalization has dictated what
information is in each form. When the user is filling out form1 it is very
useful to see the info from form2. For this reason I put a subform on form1
that shows all info from form2 but I don't want the user to mistakenly change
data on the sub form so I set its Allow Edits property to no. Problem is now
when I open Form2 as a regular form its Allow Edits property is set to no.
Whats the easyest way to remedee this? Any help would be appreciated.
S Rawson - 25 Feb 2006 14:54 GMT
You could add a line of code in VBA in the onopen:
form.allowedits = true

To do this, go into the form in design view.  Click View>Code.

In the drop down boxes, select 'Form' in the left and 'Open' on the right.
After Private sub...., go to a new line and type form.allowedits = true,
ensuring End sub is on the next line.
bbrazeau - 25 Feb 2006 15:28 GMT
Thanks S Rawson, but doing what you said affects both the subform and the
form. Maybe because they both have the same record source. Is there a way to
set the form.allowedits for form2 form the onopen event of form1? Maybe by
something like: subform.allowedits=false?

>You could add a line of code in VBA in the onopen:
>form.allowedits = true
[quoted text clipped - 4 lines]
>After Private sub...., go to a new line and type form.allowedits = true,
>ensuring End sub is on the next line.
Rick Brandt - 25 Feb 2006 15:45 GMT
> Thanks S Rawson, but doing what you said affects both the subform and
> the form. Maybe because they both have the same record source. Is
> there a way to set the form.allowedits for form2 form the onopen
> event of form1? Maybe by something like: subform.allowedits=false?

A form and subform both having the same RecordSource suggests a design flaw.  Do
you have them both also displaying the same record?

By the way, you would set AllowEdits of the *subform* to false, not the
AllowEdits of the main form.

Me.SubformControlName.Form.AllowEdits = False

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

bbrazeau - 25 Feb 2006 15:51 GMT
I think I got it:

1.Problem: Had a form (form1) with a subform based on (form2) and didn’t want
user to mistakenly change data on subform. If I set (form2)s “form.
allowedits” property to no or yes, it affected both the form and subform
instances.
Solution: When editing form1, if your careful you can pick the subform close
to its edge, right click, and get properties for the subform. In these
properties you set “locked” property to true.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.