473,394 Members | 1,766 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,394 software developers and data experts.

Linking two subforms in datasheet view?

Hi,

I have created a main form with 2 subforms,

Both subforms are in datasheet view.

I want to be able to pick a record from subform1 and the corresponding
linked record (created by a 1-to-many relationship) will show up in
subform2.

My problem is, I can't create a link between the 2 subforms. I can
only link subform2 to the mainform, which is in single form view (I
want it in datasheet view to see all the records at once). Is there
any work around?

Note: I was thinking of selecting a record in subform1, "force" the
main form (using Dlookup??) to go to that record, then the subform2
will be able to reference to that record by using a "child/parent"
relationship. Can this be done?

Any advice is much appreciated.

Rgds,
Peter

Feb 13 '07 #1
1 8310
There are a couple of ways you can do what you are describing.

Method 1: Not parent child but does keep them linked.
1) subform 1 keep as is
2) subform 2 have it based on a query that references the field in
subform 1 that controls it.
3) In the OnCurrent event of SUBFORM 1 issue a requery of subform2
4) If you create records in subform2 you will need to add an before
insert event to load the key information from subform1 into that field
in subform 2
Method 2: A true parent child relationship
1) On the main form place an unbound field which usually is NOT
visible.
2) In the OnCurrent event of subform 1 move the key field to that
field on the main form.
3) When on the form properties of subform 2 place the name of the
unbound field in the parent location and the matching field in the
child field. YOU WILL NEED TO DO THIS MANUALLY. The parent child
wizard will not function.
4) New records that you add in subform2 will automatically have the
linking field loaded.

Hope this gives you some ideas.

Ron

Feb 13 '07 #2

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

Similar topics

3
by: Keith Wilby | last post by:
I have a form which allows both form and datasheet views. My question is, is it possible to control the field (column) names in datasheet view? What happens at the moment is that the name is...
3
by: Kent Eilers | last post by:
I want to follow naming conventions for my controls - i usually prefix combo boxes with "cbo". When a form is in datasheet view however i do not want the user to see the 'cbo' prefix in front of...
2
by: Georges Heinesch | last post by:
Hi: I have a tables in relationship to each other. When I open the main table (table 1), I see a "+" at the very left of every record. Clicking on the "+" expands the data of the linked table...
1
by: Yuki | last post by:
I am trying to find out if I can have a specific record that has been selected in a list box be opened in datasheet view. I can't seem to find where this can happen or what I need to use to make...
2
by: Tom van Stiphout | last post by:
Hi All, Access 2003. I would like to indicate required fields with a special background color. Easy for parent forms, but I also have several subforms in datasheet view. For those, I would like...
0
by: fredloh | last post by:
my application have customers and invoices. each customer can have 1 or more invoices. on my form i have a subform for customers and one subform for invoices. both subforms are in datasheet view....
7
by: CCHDGeek | last post by:
I have a subform that is searched according to a field value on the main form. The subform has mutiple pages and each page has a subform based off a query. Today when I logged into the main form,...
2
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
1
by: Alex Benitez | last post by:
I want to have a form with 2 subforms...1 subform would be the parent table...and the 2nd subform would be the child table and they both would be in datasheet view. I want to see all records in the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.