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

Subform datasheet with many-to-many junction table

In an MS Access Project tied to SQL Server, I am trying to create a data entry form that allows the user to enter info about a law, and then (in a datasheet) edit/insert related web site records (text fields: link title, URL, and description). I have created a main form "law" (text fields in single form) with a subform "links" (text fields in a datasheet format). The "law" and "links" are associated through a junction table "lawlinks".

How can I limit the display of records in the "links" subform to only those records that apply to the "law" that is displayed in the main form? (Note that I do not have a Master/Child relationship defined, as that did not appear to work with junction tables.)

Any help is appreciated.
Oct 24 '08 #1
1 2986
nico5038
3,080 Expert 2GB
You'll need the Master/Child linking,but you'll have to start with adding a linked subform for the LawLinks table. (Linking by the Law of course)

Next add to the master form a (optionally hidden) textfield txtLink.
In the OnCurrent event of the sfrmLawLinks add this code:
Expand|Select|Wrap|Line Numbers
  1. Parent.txtLawLinks = Me.Link
  2.  
Now add the subform for the LawLink additional table and manually add the Master/Child link based on the Law_ID of the masterform and the txtLink of the sfrmLawLinks. This will automatically fill the both fields in the subform when adding records.

Getting the idea ?

Nic;o)
Oct 24 '08 #2

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

Similar topics

1
by: Peter D | last post by:
I have a form which contains a subform (in datasheet). When I click on a row in the subform (a button is placed there), I want the parent form's record display what i clicked in that subform....
6
by: Tim Marshall | last post by:
Here's the situation. A form, frmSetUp, with a subform control called subExplain with a source object form frmSetUpSubDefineSides. The source object is a bound form, displaying a few records, no...
3
by: kevin.jonas | last post by:
What is the line of code to select the first record of a subform? I have a form with two subforms. What you select in one subform controls what is queried in the second subform. however when the...
4
by: Praetorian Prefect | last post by:
I don't know what step I am missing. I have three tables, tbl_A, tbl_B and tbl_C. Common fieldnames for tbl_A and tbl_B is , and is found in tbl_B and tbl_C. On the main form I have a combo box...
1
by: Robert | last post by:
How do I set the value in an unbound column in a datasheet subform based on the value in another column (field) in the same row? This would be for the startup of the form. If I create a join for...
30
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform named "sbfrmParts" with a list of parts along with the quantity and price. I have used a text box in the subform's footer and set the control source to "=Sum(*)". I set the...
1
by: igniztion | last post by:
Hi, When I paste several rows into datasheet view in MS Access, does this trigger a single INSERT with all the rows, or is it counted as one INSERT statement per row? Vegard
2
by: ruthboaz | last post by:
Hi, My database is in SQL Server with Access as front end. I have a Microsoft Graph Chart for which the data is picked up with a query from the SQL Server. In the DataSheet the first row is...
5
by: goldenbear | last post by:
Has anyone experienced where only one person using a shared Access 2003 db in a muti-user environment displays unreadable characters in the header and field of a datasheet subform?
2
by: Element | last post by:
I have a master form with a simple subform that displays line items in datasheet mode. Everything works fine, except that when the subform has the focus, the standard Access sorting and filtering...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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.