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

Changing relationships in form

I have a form with Members and in that form a subform with Transactions.
Those are linked (on banknr) 1xM which I've set in the database relations.
Now I would like to copy the form and modify it. I would like Transactions
to become the main table in the form so I can filter all new Transactions
(seems like a Mx1 relation). When new transactions have arrived I would like
to go through them one by one, and make some changes in the linked Members.
I'd rather not design the whole form again. My questions are:
1. Can I have a relation between tables specifically for one form and
independent of the main database relations and where do I set that?
2. How can I use all the layouting of my first form to create this new form.
Thanks in advance,
john
Sep 2 '06 #1
3 1695
john wrote:
I have a form with Members and in that form a subform with Transactions.
Those are linked (on banknr) 1xM which I've set in the database relations.
Now I would like to copy the form and modify it. I would like Transactions
to become the main table in the form so I can filter all new Transactions
(seems like a Mx1 relation). When new transactions have arrived I would like
to go through them one by one, and make some changes in the linked Members.
I'd rather not design the whole form again. My questions are:
1. Can I have a relation between tables specifically for one form and
independent of the main database relations and where do I set that?
You already have a relationship between Members and TXs on banknr. What
other relationship do you propose?

FYI, you can change recordsources in forms. Let's say you wanted a form
to present either Customer or Employee data. Both tables have similar
data to present and in the queries you have ensured the columns have the
same names. The following shows how to change the CustomerID field to
have the name as EmpID. Ex:
EmpID : CustomerID
Here the CustomerID field will have a column alias of EmpID. Now when
you open the form you can pass the argument to the form of "Emp" or
"Customer". If the recordsource is Emp, you keep the same recordsource,
otherwise use the Customer recordsource. Ex:
'from the calling form
Docmd.Openform "EmpCust",,,,,,"Customer"

'OnOpen event of called form
If Me.OpenArgs = "Customer" then
'only need to check for cust since default
'recsource is Emp.
Me.Recordsource = "CustomerQuery"
Endif
2. How can I use all the layouting of my first form to create this new form.
Why bother? You are going from a form with Members and subform a list
of TXs related to the member. If seems ludicrous to have the subform
drive which records are displayed in the mainform based on the subform'r
records.

Queries can be used as recordsets...just like tables. You could create
a query with both tables...Create a new query, drop in the two tables,
and drag the fields into the columns you want on your form. Then create
a continuous form that lists those fields with the recordsource of that
query. If you want to update info for members, have an OnDblClick event
to open a form that presents the member data and update the member data
there. Close the single form and continue on.
Thanks in advance,
john
Sep 2 '06 #2
"salad" <oi*@vinegar.comschreef in bericht
news:Ge****************@newsread4.news.pas.earthli nk.net...
john wrote:
>I have a form with Members and in that form a subform with Transactions.
Those are linked (on banknr) 1xM which I've set in the database
relations. Now I would like to copy the form and modify it. I would like
Transactions to become the main table in the form so I can filter all new
Transactions (seems like a Mx1 relation). When new transactions have
arrived I would like to go through them one by one, and make some changes
in the linked Members. I'd rather not design the whole form again. My
questions are:
1. Can I have a relation between tables specifically for one form and
independent of the main database relations and where do I set that?

You already have a relationship between Members and TXs on banknr. What
other relationship do you propose?
The type of relationship is different because now I want all records of TXs
and only those of Members that matches TXs on banknr. In my firs form it is
the other way around.
FYI, you can change recordsources in forms. Let's say you wanted a form
to present either Customer or Employee data. Both tables have similar
data to present and in the queries you have ensured the columns have the
same names. The following shows how to change the CustomerID field to
have the name as EmpID. Ex:
EmpID : CustomerID
Here the CustomerID field will have a column alias of EmpID. Now when you
open the form you can pass the argument to the form of "Emp" or
"Customer". If the recordsource is Emp, you keep the same recordsource,
otherwise use the Customer recordsource. Ex:
'from the calling form
Docmd.Openform "EmpCust",,,,,,"Customer"

'OnOpen event of called form
If Me.OpenArgs = "Customer" then
'only need to check for cust since default
'recsource is Emp.
Me.Recordsource = "CustomerQuery"
Endif
>2. How can I use all the layouting of my first form to create this new
form.

Why bother? You are going from a form with Members and subform a list of
TXs related to the member. If seems ludicrous to have the subform drive
which records are displayed in the mainform based on the subform'r
records.

Queries can be used as recordsets...just like tables. You could create a
query with both tables...Create a new query, drop in the two tables, and
drag the fields into the columns you want on your form. Then create a
continuous form that lists those fields with the recordsource of that
query. If you want to update info for members, have an OnDblClick event
to open a form that presents the member data and update the member data
there. Close the single form and continue on.
I'll look into that. Thanks.
john
Sep 3 '06 #3
john wrote:
"salad" <oi*@vinegar.comschreef in bericht
news:Ge****************@newsread4.news.pas.earthli nk.net...
>>john wrote:
>>>I have a form with Members and in that form a subform with Transactions.
Those are linked (on banknr) 1xM which I've set in the database
relations. Now I would like to copy the form and modify it. I would like
Transactions to become the main table in the form so I can filter all new
Transactions (seems like a Mx1 relation). When new transactions have
arrived I would like to go through them one by one, and make some changes
in the linked Members. I'd rather not design the whole form again. My
questions are:
1. Can I have a relation between tables specifically for one form and
independent of the main database relations and where do I set that?

You already have a relationship between Members and TXs on banknr. What
other relationship do you propose?


The type of relationship is different because now I want all records of TXs
and only those of Members that matches TXs on banknr. In my firs form it is
the other way around.
I see no difference. A relationship is a relationship. But it seems
odd to have a subform define the actions of the mainform. In fact, it
doesn't make sense. For example, if the link between main/sub forms is
the memberid, how would the subform display main recs of another Memberid?
>
>>FYI, you can change recordsources in forms. Let's say you wanted a form
to present either Customer or Employee data. Both tables have similar
data to present and in the queries you have ensured the columns have the
same names. The following shows how to change the CustomerID field to
have the name as EmpID. Ex:
EmpID : CustomerID
Here the CustomerID field will have a column alias of EmpID. Now when you
open the form you can pass the argument to the form of "Emp" or
"Customer". If the recordsource is Emp, you keep the same recordsource,
otherwise use the Customer recordsource. Ex:
'from the calling form
Docmd.Openform "EmpCust",,,,,,"Customer"

'OnOpen event of called form
If Me.OpenArgs = "Customer" then
'only need to check for cust since default
'recsource is Emp.
Me.Recordsource = "CustomerQuery"
Endif

>>>2. How can I use all the layouting of my first form to create this new
form.

Why bother? You are going from a form with Members and subform a list of
TXs related to the member. If seems ludicrous to have the subform drive
which records are displayed in the mainform based on the subform'r
records.

Queries can be used as recordsets...just like tables. You could create a
query with both tables...Create a new query, drop in the two tables, and
drag the fields into the columns you want on your form. Then create a
continuous form that lists those fields with the recordsource of that
query. If you want to update info for members, have an OnDblClick event
to open a form that presents the member data and update the member data
there. Close the single form and continue on.


I'll look into that. Thanks.
john
In your case, I'd simply create a continuous form of your txs linked to
the members table.
Sep 4 '06 #4

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

Similar topics

13
by: Peter | last post by:
Can anyone tell me how to change the data type of a field in a table created with a make table query? The field is a binary and must be changed to text. alternately does anyone know how to specify...
3
by: Michael | last post by:
Hi everyone, I am trying to change the field names for a table that is being exported via Excel. Its a spreadsheet that our National Office sends us but even after promise after promise they...
2
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
10
by: Dixie | last post by:
I need to delete some relationships in code. How do I know what the names of those relationships are?
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
5
by: sparks | last post by:
We have a database with 1600+ records in it. They are linked across 7 tables by an ID type autonumber. Now we want(not I want LOL) to remove the first 1200 records no problem but they also...
1
by: laura | last post by:
I am new to Access, trying to figure it out on my own. I am trying to create a form to input the same information in 3 different tables. The 3 tables each have a different number as the primary...
2
by: stevenrec | last post by:
Hi, guess I am overlooking something, using a list, I change what info is displayed on a form that has 3 subforms. after selecting the topic to display, the subform names and links are read from...
0
by: Phil Stanton | last post by:
Sorry to repost this but I now seem to have the BE datbase corrupted. I have a FE, BE database on my home computer and a duplicate on the office computer. Both use Ak2 on Windows XP. The one at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
tracyyun
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...
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.