473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Form will not Restrict Edits

Hi I have a Form with 4 sub forms (I know that is a lot) and I've noted that even though I have put, on many events, code to stop Edits, Additions, and Deletions. Allow Edits=False Allow Additions=False Allow Deletions=False It still Allows Edits?
At least 3 times in various events, I have put this code, yet once I change the Record, forward or backward, it suddenly Allows Edits??
When I check with the Debug.Print it says Allow Edits is False, yet it Allows Edits. I immediately open the form in Design mode and everything is set to False as it should be but it Allows Edits? Ihave compacted and repaired the db multiple times as well.

Anybody have any idea what the issue could be??
Jun 5 '20 #1
9 1525
twinnyfo
3,653 Expert Mod 2GB
RIchardCK,

Welcome to Bytes!

Initially, it seems like you have everything set correctly. However, this is puzzling:
even though I have put, on many events, code to stop Edits, Additions, and Deletions
Why are you adding code to stop editing if the sub-forms already should have that property established?

Additionally, you can also Lock the Sub-Forms, so that users cannot edit them. This is done in design view for the main form.

Furthermore, if you want to go to this step (which I often do with forms that I only want to display data), you can lock the individual controls on each sub-form. This prevents anyone from making any accidental/intentional changes.

Hope this hepps!
Jun 5 '20 #2
Hi I haven't actually gotten to testing the Subforms to see if the issue is there as well, this is on the Main Forms that I am having the problem. I have only once ever locked controls which is a bit of a pain when you want to do that because you have to unlock specific types after but bottom line this may work but certainly seems like a roundabout way to get to a Normal situation. I have been doing this for a long time (30 years) and I have never seen this before
Jun 5 '20 #3
Oh and these are Data Entry Forms that allow for review as people can make mistakes and the Team lead must be able to correct them. I open the forms in Read Only Mode then it changes to Allow Edits on its own when I change records, so weird.
Jun 5 '20 #4
twinnyfo
3,653 Expert Mod 2GB
So, your last post has just thoroughly confused me more than what I was before.

What exactly is the issue?

You mention your main form with four sub-forms (which really is not a lot, if you ask me), and then mention the inability to lock data. Which data? Data on the main form? or the sub-forms? If you lock down the main form, you may still be able to edit data in the sub-forms--and vice versa.

This is why I mentioned the properties of the sub-forms, as this is what I thought you had problems with. The properties are independent in many cases.
Jun 5 '20 #5
Hi T, sorry I should have been more clear. 1) my problem starts with the Main form, I hadn't even checked the subforms because I was so stunned with the error I was having on the Main. It was not to Lock the Data perse but to Lock the Form to Disallow Edits, Additions, or Deletions on the main form. I had put code in On Load, On Open of the form then on the control that got the first Focus Got Focus, and all the codes said Allow-Edits, Additions, Deletions=False and it was fine when the Form first opened, yet once I changed the record I was looking back (Next or Previous) I could easily edit anything on the main, which was stunning. Hope I have explained it better this time
Jun 5 '20 #6
Hi T I believe I just found the error, I think you will like this one. It seems that when I trap the Err.Number = -2147352567 and let it slip by w/o generating a popup it switches the ALlowEdits to True, but if I allow the popup nothing changes, so bizarre. I will continue on this but I just found it by accident.(only way to find something weird like this)
Jun 5 '20 #7
twinnyfo
3,653 Expert Mod 2GB
This is kind of an aside, here, but do you know what is causing that error to be thrown? Sometimes I can't prevent certain errors, so I trap specific ones, like you have. But, I much prefer to prevent them in the first place.

At least you have an explanation for your problem!
Jun 5 '20 #8
Hi T, yes it is because I have a Sum field on the main form taking values from the sub forms (weight totals from a hidden Running subtotal on each sub form, I then feed hat value to a control bound to a field n the record set. Sometimes the hidden fields do not have time to actually appear on the form so it counts it as an "invalid value" but there is no value because the hidden control has not yet appeared or taken the values from the her subforms. Hmm I see where you are going with this I will check the time of events for when the controls appear, d which events fire after e controls appear and maybe that will help. MY other fix seems to have t worked properly either there is a way round it and I am sure the users will d it. :)) You know how Users can be :))
Jun 5 '20 #9
NeoPa
32,556 Expert Mod 16PB
I don't know if this will help but I had something a little similar myself recently when I was setting editability (AllowEdits) for a subform within the Form used in the subform. I too noticed that when this was run on opening of the Form it often crashed. I bodged it with an error handler but I then realised that if I triggered the change of setting in the OnCurrent event of the main form it worked reliably.

It also gets set in the OnCurrent of the subform but the parent form setting ensures it's set correctly before moving between records in the subform.
Jun 5 '20 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bob Alston | last post by:
On a form I developed, I want to do some cross-field dependencies. If field1 = "xxx" then field2 must be "yyyy" and so forth. Apparently I cannot do that in field properties via the validation as...
2
by: Matt | last post by:
Hi All, I have a form that was given to me to fix, so I do not have a ton of background here but I will do my best. Also, my form design experience is somewhat lacking, so here goes: ...
8
by: bruno_guedesav | last post by:
This has ocurred before, but if the person had find a way to solve it or not, I've got no clue. So, here I am to ask for help. I've created a form via pure PHP, basically a bunch of prints...
3
scubak1w1
by: scubak1w1 | last post by:
Hello, I posted this in the HTML forum, but it was suggested I post it over here as well by a moderator. I have a form that will not 'fire' in non-IE browsers?? I have poked and poked at the code...
4
by: dfluker | last post by:
This form will not send the email to my account and I used other forms to submit emails using examples that I googled but I can't get this form to process the request. Can someone tell me what i'm...
0
by: eneyardi | last post by:
I have a form1 and form2, in project properties i select form2 as a startup form, but when i click start debugging, the startup form is form1 instead of form2. How the startup form will take effect?...
2
by: lauralofrumento | last post by:
Hi: I am having issues with the below code. I can not figure out why the form will not direct to the appropriate email based on the state that is selected. It will only direct to "Other". Please...
1
by: mkisii | last post by:
Am requesting help with a simple java script code that will put restriction on a specific text box in a form on the format of character to be feed format PCA/2013/---- THE FIRST PART (PCA/2013/)...
1
by: Coreiy87 | last post by:
I have developed a database to record enquiries for English courses that I offer. Information is entered via forms. Once a record is created, adjustments may need to be made later if the status of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.