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

Form-subform links - am I breaking the rules?

What are the rules regarding the linking fields between a form and
subform? Does the field on the main form *have* to be based on a
primary key?

Most examples seem to quote the use of a primary key on the main form,
but I've seen one or two places where it's implied that this doesn't
have to be the case - references in the help file to 'normally' using
a primary key, etc.

For various historical reasons I find myself having to associate a
subform to its parent using a field that isn't unique in the table on
which the main form is based. However, due to the way the main form
works, that data *will* be unique within the master form's recordset
at all times.

It appears to work in practice...

Can anyone confirm that this is a legitimate approach to take, given
that I can't use a primary key.

Thanks,

Mike
Nov 13 '05 #1
1 1272
Hi Mike,

I'm not sure that it *has* to be the PK either. I believe that in most cases
that it *should* be, and that perhaps you may want to look at your table
structure to see if you might be going around it the wrong way. If data from
one table relates to data in another, there should be a way to join them. It
may require a join table to complete a many-to-many relationship for
example.

I do know that I've had a couple of occasions where I want to "auto-fill"
more than one field in my subform. I had figured out that the
LinkMaster/LinkChild automatically did this for one field, so I thought
"what the heck" ... and tried using a 2-field join. You can "pair" them by
simply adding a semi-colon between them, but the quantity and order of the
fields must remain the same. Both fields in the subform do get auto-filled.
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

================================

"Mike Heden" <mh****@bigfoot.com> wrote in message
news:53*************************@posting.google.co m...
What are the rules regarding the linking fields between a form and
subform? Does the field on the main form *have* to be based on a
primary key?

Most examples seem to quote the use of a primary key on the main form,
but I've seen one or two places where it's implied that this doesn't
have to be the case - references in the help file to 'normally' using
a primary key, etc.

For various historical reasons I find myself having to associate a
subform to its parent using a field that isn't unique in the table on
which the main form is based. However, due to the way the main form
works, that data *will* be unique within the master form's recordset
at all times.

It appears to work in practice...

Can anyone confirm that this is a legitimate approach to take, given
that I can't use a primary key.

Thanks,

Mike

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
3
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table...
5
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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.