I have an Access 2002 main form ("Project Initiation Checklist") with a subform ("sfPICMileston e"). 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
4 8138
...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
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 programmaticall y link the two ID fields together so that the same ID number is reflected on the main form and subform?
- JM
...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 programmaticall y 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
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]
Sign in to post your reply or Sign up for a free account.
Similar topics |
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. however, I
would like to be able to add a new client in the subform but this is,
of course bound to the combo box. Can anyone tell me if there is a way
to enter a new client in the subform with out receiving an error
message?
TIA - Ray
|
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 is saved and then choose to save it or
undo it. I have a Save button that just closes the form and a Cancel button that
does an undo and then closes the form. I first enter data into the main form
and then enter code into the subform. After the...
|
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 many hours and for
which projects they've already made entries.
To do this, I created a query based on the same table with criteria
pointing to the current user, and the week selected in the main form.
This seems to work fine except the...
|
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.
Me. = Forms!!) All
of the new records on the subform are related through the "RunNumber"
on the main form. The main form also subtotals the weights on the
subform to allow the user to double check totals against paperwork.
When the user wants to...
|
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 activities (like
from a mailing - received return no forwarding address, received
updated address, called us, etc)
The other subform is for addresses, original and updated.
There is a date field for the date of any updated addresses.
| |
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 with. If a
user enters data in a subform, then directly clicks the command button
on the parent form, the data in the subform is not included in their
document. I THOUGHT that as soon as focus left the subform, any
pending changes to the data...
|
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 which allows me
to edit the record in the subform. What I want to happen is for
subform with the new edits to be updated on the main form when I close
the popup. I'm sure this is a very small bit of code in the the 'On
close' event for the popup...
|
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
visibility.
I have tried the visibility without the locked attribute in case of
interference.
I have also tried variations of the visibility statement and
I have also tried the visibility statement in other locations, as in
|
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 'continuous' forms. Which works fine when i open them as main form. However, as soon as i use them as subforms i can't enter or select anything from the unbound textbox and combo box on the subform.
I have checked both the mainform, subform and...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |