We help IT Professionals succeed at work.

Subform Link field

Derek Brown
Derek Brown asked
on
98 Views
Last Modified: 2016-10-17
I have a main form (Table "A") with a command button that opens form "Sets"(Table "Sets"). When a new record is created in the main form I want to be sure that the "Sets" form has a corresponding and linked record even when the form has not been opened.

The linking field between the forms is ItemNumber. So in the past I have used

"If IsNull(Form![Sets].ItemNumber) Then "Sets" form!Sets.ItemNumber =MainForm.ItemNumber"

I am sure that this will not work if the form is closed but I don't want the user to have to open the form or program an open and close procedure.

Is there something in access like ""Always create a record in the "Sets" table where Table "A" has a record

Or would that happen naturally if the tables are linked on a 1 to 1 basis
Comment
Watch Question

John TsioumprisSoftware & Systems Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
If you put Sets as a subform and link it to TableA...everytime you have a new record on form(tableA) you will get a corresponding record on Sets...
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
if the tables are 1:1 and you always create a record in the second table, why not just put all the fields in table "A"?

Author

Commented:
Crystal my life is never that simple. I already have 210 fields in Table "A" It cannot be any more normalised. I have to close and open because I am bumping up against the 2048 max links with Access. Often the Sets form is just not required. But if I don't have a number in the linked field it causes problems elsewhere.

It just seems daft that you have to force a link.

Hi John
The link in a subform only happens when data is put on the subform (as far as I am aware). As I say I don't want to force an entry because any sensible user will ask why.
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
210 fields! A well designed database will usually have less than 20 fields in a table, with some exceptions such as Orders that record point-in-time values.
What is the database for?

Author

Commented:
The specification of fire doors
Doors.pdf
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
I don't see a couple hundred fields ...

Each of the panels should be in a related table with dimensions relative to your origin.  However, you probably make other types of doors and even fire doors might look different.  It would be best to see what is in common and break down information so that you can set up tables to define each door type and then equations to render it since people might get a door that is 8' tall or 7' tall or 3' wide or 2'10" wide, etc

You should have several tables.

What is the purpose of the database? to store specs for drawing? for making? for cutting pieces?

Author

Commented:
Hi Crystal

The purpose is all of that. A lot of information is hidden and yet more are in invisible subforms. Here is the input form. I know that it is complex but I will not have my users constantly opening and closing forms. Almost Everything here that describes the product is visible to the operator. So if a customer calls with an inquiry it can be seen immediately.  Also when something is changed I.e. the door width everything related to that has to change automatically so I would have to open a form do a separate calculation and paste it into the table. Everything here is calculated by the underlying query or background code
Capture13.PNG
John TsioumprisSoftware & Systems Engineer
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
while I can understand you wanting to see everything on one form ... did you know that a form can be ON another form? It is called a subform when it is used for that purpose.

As an example, you have provisioned for up to 6 vision panels ... what if they want 8? Do you plan to add more fields? I see that you should have a related table for panels.  It could be designed as a continuous form and show however few, or however many, panels there are.  Right away, this would get rid of a bunch of fields in table "A" and move them to where they belong.

here is a short book with lots of screenshots you can read:

Access Basics
http://www.AccessMVP.com/strive4peace

the basics don't change

Author

Commented:
The vision panel detail is actually a subform without borders and there are 6 more not visable. I have never seen a doors with more than 6 vision panels in each door.

Hi Crystal

The reason I don't use a continuous form is because if you look at the first numeric box it is entitled DFT (Down From Top of door. The starting point for the first vision panel) the next to the right is BVP (Between the first vision panel and the next) If I had a continuous form it would read DFT which means the user would have to calculate the new distance from the top including the first vision panel and the gap between the two. When you get to the sixth VP that's not so easy. When the information received from THEIR customer would read "Between Vision Panel". My philosophy has always been "make Access work hard, not the customer"

Hi John

Is your problem a product orientated DB as well?

To fully describe a door set you need the equivalent to 500+ fields. I started this 10 years ago and have to accept some bad practice. But I thought a database was supposed to have one table per subject. 500 fields is one subject. I am sure you are both right but I need a simple answer to the question can it be done do you think?
Remote Training and Programming
CERTIFIED EXPERT
Top Expert 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
My thanks to you both.

John How are you remedying the situation.
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and Programming
CERTIFIED EXPERT
Top Expert 2015

Commented:
you're welcome ~ happy to help
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.