473,668 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1710
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 = "CustomerQu ery"
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...ju st 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.co mschreef in bericht
news:Ge******** ********@newsre ad4.news.pas.ea rthlink.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 = "CustomerQu ery"
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...ju st 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.co mschreef in bericht
news:Ge******** ********@newsre ad4.news.pas.ea rthlink.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
Transactio ns to become the main table in the form so I can filter all new
Transactio ns (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
independen t 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.Openfor m "EmpCust",,,,,, "Customer"

'OnOpen event of called form
If Me.OpenArgs = "Customer" then
'only need to check for cust since default
'recsource is Emp.
Me.Recordsour ce = "CustomerQu ery"
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...ju st 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
2906
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 the field type when running a make table query? Thanks, Sven
3
3021
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 keep changing the field names which makes it nearly impossible to run any pre-generated queries etc. The solution really is to get someone to check the field names before importing the spreadsheet but I want to do it in code. I have written
2
2688
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 how many relationships to create. i am also trying to figure out what relationships to create.
10
7008
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
3393
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 relationship spaghetti....tables/queries all overthe place with lots of relationship lines between here and there. After that first app I didn't do relationships. If I had a query, I defined the relationship. Many of the times when I create a...
5
2164
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 want the ID to be reset to 1,2,3 ... this would mean that record 1234=1 1235=2 With the id being linked across 7 tables with relationships...one to one and some with one to many..can this be done without messing up the links?
1
1649
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 key, although they each do contain the other 2 numbers in their tables. I have been unsuccessful and am wondering if perhaps my relationships are inaccurate.
2
1850
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 a table, then the master form is updated using the info 'all values = string variable Me.Sfrm_3.SourceObject = form_3 Me.Sfrm_2.SourceObject = form_2
0
1395
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 home appears normal. The BE consists of about 50 tables with numerous relationships and the FE 9 tables (fixed set up stuff) + the 50 linked table from the BE database. At home on the relationship view I see all the tables and their...
0
8374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8653
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.