473,397 Members | 2,056 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,397 software developers and data experts.

How to correct locked subform to enter data

I have an Access 2002 main form ("Project Initiation Checklist") with a subform ("sfPICMilestone"). The Link Child Field is ID and the Link Master Field is also ID. The linked field is an auto-generated number and the main form's primary key.

I'm having problems with my subform such that when I attempt to enter or edit data in its text boxes, its as if the subform is locked. Similarly, all controls on the main form are also locked. I can click on each control but cannot type or select, as required.

Perhaps there's something in the form or sub-form properties that I have to change, but I haven't been able to put my finger on it. I have a similar relationship for another set of forms/sub-forms but don't have this problem. Could there be any event procedures with the main form that are causing both forms to lock up when the sub-form is "activated"?

Help, please!!

Regards,

- JM
Feb 27 '08 #1
4 8115
Stewart Ross
2,545 Expert Mod 2GB
...I'm having problems with my subform such that when I attempt to enter or edit data in its text boxes, its as if the subform is locked. Similarly, all controls on the main form are also locked. I can click on each control but cannot type or select, as required.

Perhaps there's something in the form or sub-form properties that I have to change, but I haven't been able to put my finger on it. I have a similar relationship for another set of forms/sub-forms but don't have this problem. Could there be any event procedures with the main form that are causing both forms to lock up when the sub-form is "activated"?...
Hi JM. It is certainly possible to set forms and subforms to non-updatable using event procedures. There are three main properties which can be toggled false or true which combine to set that form as read-only or updatable: AllowEdits, AllowAdditions, and AllowDeletions. If there are event procedures changing these properties you will see these listed against one or more of the On Open/Load/Current events in the form's properties tab, and the form's code module will contain the event handler code that actually changes their values (or calls another process to do so).

If the forms properties are set as you would expect and there are no event procedures stopping updates it would suggest that the recordsources are not updatable. Is the recordsource of the subform the related table, or is it a multi-table query? If it is a query, have the key fields been taken from the correct tables (the one-side tables?) I mention this because it is easy to include the key fields from the many-side table relationships, and this can lead to an apparently updatable query not allowing the addition of new records because of key faults, which in turn prevents the subform from working.

Let is know what you find.

Regards

Stewart
Feb 27 '08 #2
Hi JM. It is certainly possible to set forms and subforms to non-updatable using event procedures. There are three main properties which can be toggled false or true which combine to set that form as read-only or updatable: AllowEdits, AllowAdditions, and AllowDeletions. If there are event procedures changing these properties you will see these listed against one or more of the On Open/Load/Current events in the form's properties tab, and the form's code module will contain the event handler code that actually changes their values (or calls another process to do so).

If the forms properties are set as you would expect and there are no event procedures stopping updates it would suggest that the recordsources are not updatable. Is the recordsource of the subform the related table, or is it a multi-table query? If it is a query, have the key fields been taken from the correct tables (the one-side tables?) I mention this because it is easy to include the key fields from the many-side table relationships, and this can lead to an apparently updatable query not allowing the addition of new records because of key faults, which in turn prevents the subform from working.

Let is know what you find.

Regards

Stewart
Thanks, Stewart. I found the AllowEdits property on the main form to be set on 'No'. Switching it to 'Yes' allowed me to 'unlock' the form.

My newest problem deals with the "ID" field, which is my linked parent and child field. On the main form, the ID field is the primary key and an auto-generated number. For example, if you have 100 records in a table. Activating the main form generates a new record with the ID field auto populated to the next number in the sequence, in this case: 101.

My problem is that I want the linked ID field on the subform to reflect the same number on the main form (i.e., 101), but it instead generates the next number in the sequence (i.e., 102). Is there a way to programmatically link the two ID fields together so that the same ID number is reflected on the main form and subform?

- JM
Feb 28 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
...My newest problem deals with the "ID" field, which is my linked parent and child field. On the main form, the ID field is the primary key and an auto-generated number. For example, if you have 100 records in a table. Activating the main form generates a new record with the ID field auto populated to the next number in the sequence, in this case: 101.

My problem is that I want the linked ID field on the subform to reflect the same number on the main form (i.e., 101), but it instead generates the next number in the sequence (i.e., 102). Is there a way to programmatically link the two ID fields together so that the same ID number is reflected on the main form and subform?
Hi JM. This new problem should properly be started as a new thread, so that it is available under the correct heading for others to search.
To return to your ID number problem, I wonder if the ID field in your linked table is also an autonumber? It would be very strange if it was, but I can think of no other explanation for differing values being created, unless there is something else going on in your form that is generating another record and hence setting the next autonumber.

The ID field of the many-side table matching an autonumber on the one-side table should simply be a Long value. In many years of using main form/subform combinations in various versions of Access I have not come across any similar problems with the parent-child field link - perhaps other contributors could come up with an alternate explanation?

Regards

Stewart
Feb 28 '08 #4
Stewart Ross
2,545 Expert Mod 2GB
Postscript JM: If the mainform number is not the same as the subform surely you should not see the subform record at the same time as the main form record; if the mainform record is 101 then the subform record surely can't be showing 102 at the same time? To do so would violate the linking relationship. Odder and odder...

[font=Verdana][size=2]-Stewart[/size][/font]
Feb 28 '08 #5

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

Similar topics

6
by: Ray | last post by:
I have a main form with a subform. The main form has a combo box which lists all the clients which in turn are displayed in the subform. The subform is bound to the combo box and all work well....
1
by: Susan | last post by:
I have a bound form and subform and am trying to enter the data in both forms programatically. The Linkmaster and Linkchild properties are set. My intent is to be able to look at the data before it...
1
by: New2Access | last post by:
Hi, I have a form thats used to enter records into a table. The table and form have fields for Name, week, project, and hours. To assist users, I wish to add a subform that will show them how...
1
by: Momo4 | last post by:
I have a unbound main form with unbound fields that correspond to fields on a bound data sheet subform. As you enter data on the subform, the corresponding fields get updated through code (e.g....
0
by: nospam | last post by:
I have a main form that has 3 fields. They are all locked fields, only to show the user the "person" record that they are looking at. They update to subforms on a tab. The first subform is...
1
by: google | last post by:
I have a form with several subforms. Users enter the data, then on the parent there is a command button that runs code to generate a .pdf document from a report based on the data they are working...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
8
by: kevin.vaughan | last post by:
Good Afternoon Everyone, Could someone please explain why I can't set the Subform control Visible attribute to False as below? The statement for the locked attributes work but not for the...
7
reginaldmerritt
by: reginaldmerritt | last post by:
I have a few forms which i have designed to be subforms to a mainform that has no fields or record source. The forms have an unbound textbox and combo box, which i use to seach the data on these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.