By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Single form to control two similar tables.

P: n/a
Hello All,

I am trying to link to an existing database and extend the
funcitonality by adding a phone call logging extension, so you can see
a list of phone calls for a given customer.

There are two similar address tables (USA and international), which are
almost the same except for some shipping addresses. The fields I'm
interested in are all the same. So, I have:

TABLES:
tblAddress (linked)
tblAddressInternational (linked)
tblPhoneCalls (new)

FORMS:
FormAddress - based on tblAddress - shows customer specifics
FormPhoneCalls - based on tblPhoneCalls - shows details of a call.
FormCallsByCustomer (main uses tblAddress, Subform uses
tblPhonecalls)

Currently, the tblPhoneCalls stores a foreign key to identify the
customer in the tblAddress. I can pretty much do everything I want with
US users, but can't see the international users.

SOOO - What I am wondering, is, is there any way that I can generate a
query that will combine the two similar address tables into a single
table, and base my FormCallsByCustomer on that.

It seems to me that I can create such a table, but I have trouble
conceiving of what foreign key is inserted in the tblPhoneCalls to keep
track of it, and whether I will have problems due to the tblAddress and
tblAddressInternational having new records added at different times.

Thanks in advance.
Steves
stevesATeyeDASHimagingDOTcom

Jan 17 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 16 Jan 2007 20:08:00 -0800, "steves" <st************@sbcglobal.net>
wrote:

That's what UNION queries are for:
Select <5 fieldsfrom Table1
UNION
Select <5 fieldsfrom Table2

-Tom.

>Hello All,

I am trying to link to an existing database and extend the
funcitonality by adding a phone call logging extension, so you can see
a list of phone calls for a given customer.

There are two similar address tables (USA and international), which are
almost the same except for some shipping addresses. The fields I'm
interested in are all the same. So, I have:

TABLES:
tblAddress (linked)
tblAddressInternational (linked)
tblPhoneCalls (new)

FORMS:
FormAddress - based on tblAddress - shows customer specifics
FormPhoneCalls - based on tblPhoneCalls - shows details of a call.
FormCallsByCustomer (main uses tblAddress, Subform uses
tblPhonecalls)

Currently, the tblPhoneCalls stores a foreign key to identify the
customer in the tblAddress. I can pretty much do everything I want with
US users, but can't see the international users.

SOOO - What I am wondering, is, is there any way that I can generate a
query that will combine the two similar address tables into a single
table, and base my FormCallsByCustomer on that.

It seems to me that I can create such a table, but I have trouble
conceiving of what foreign key is inserted in the tblPhoneCalls to keep
track of it, and whether I will have problems due to the tblAddress and
tblAddressInternational having new records added at different times.

Thanks in advance.
Steves
stevesATeyeDASHimagingDOTcom
Jan 17 '07 #2

P: n/a
So,

If I perform a UNION query on my two tables, does the resulting dataset
have an "AutoID" field that I can use as a foreign key in my "Phone
Calls" table, which will point me to the correct row?
Tom van Stiphout wrote:
On 16 Jan 2007 20:08:00 -0800, "steves" <st************@sbcglobal.net>
wrote:

That's what UNION queries are for:
Select <5 fieldsfrom Table1
UNION
Select <5 fieldsfrom Table2

-Tom.

Hello All,

I am trying to link to an existing database and extend the
funcitonality by adding a phone call logging extension, so you can see
a list of phone calls for a given customer.

There are two similar address tables (USA and international), which are
almost the same except for some shipping addresses. The fields I'm
interested in are all the same. So, I have:

TABLES:
tblAddress (linked)
tblAddressInternational (linked)
tblPhoneCalls (new)

FORMS:
FormAddress - based on tblAddress - shows customer specifics
FormPhoneCalls - based on tblPhoneCalls - shows details of a call.
FormCallsByCustomer (main uses tblAddress, Subform uses
tblPhonecalls)

Currently, the tblPhoneCalls stores a foreign key to identify the
customer in the tblAddress. I can pretty much do everything I want with
US users, but can't see the international users.

SOOO - What I am wondering, is, is there any way that I can generate a
query that will combine the two similar address tables into a single
table, and base my FormCallsByCustomer on that.

It seems to me that I can create such a table, but I have trouble
conceiving of what foreign key is inserted in the tblPhoneCalls to keep
track of it, and whether I will have problems due to the tblAddress and
tblAddressInternational having new records added at different times.

Thanks in advance.
Steves
stevesATeyeDASHimagingDOTcom
Jan 19 '07 #3

P: n/a
On 19 Jan 2007 09:59:28 -0800, "steves" <st************@sbcglobal.net>
wrote:

You could enhance this query with:
Select <5 fields>, "Table1" As FromTable from Table1
UNION
Select <5 fields>, "Table2" As FromTable from Table2

Now the FromTable column will tell you where each row came from.

-Tom.
>So,

If I perform a UNION query on my two tables, does the resulting dataset
have an "AutoID" field that I can use as a foreign key in my "Phone
Calls" table, which will point me to the correct row?
Tom van Stiphout wrote:
>On 16 Jan 2007 20:08:00 -0800, "steves" <st************@sbcglobal.net>
wrote:

That's what UNION queries are for:
Select <5 fieldsfrom Table1
UNION
Select <5 fieldsfrom Table2

-Tom.

>Hello All,

I am trying to link to an existing database and extend the
funcitonality by adding a phone call logging extension, so you can see
a list of phone calls for a given customer.

There are two similar address tables (USA and international), which are
almost the same except for some shipping addresses. The fields I'm
interested in are all the same. So, I have:

TABLES:
tblAddress (linked)
tblAddressInternational (linked)
tblPhoneCalls (new)

FORMS:
FormAddress - based on tblAddress - shows customer specifics
FormPhoneCalls - based on tblPhoneCalls - shows details of a call.
FormCallsByCustomer (main uses tblAddress, Subform uses
tblPhonecalls)

Currently, the tblPhoneCalls stores a foreign key to identify the
customer in the tblAddress. I can pretty much do everything I want with
US users, but can't see the international users.

SOOO - What I am wondering, is, is there any way that I can generate a
query that will combine the two similar address tables into a single
table, and base my FormCallsByCustomer on that.

It seems to me that I can create such a table, but I have trouble
conceiving of what foreign key is inserted in the tblPhoneCalls to keep
track of it, and whether I will have problems due to the tblAddress and
tblAddressInternational having new records added at different times.

Thanks in advance.
Steves
stevesATeyeDASHimagingDOTcom
Jan 20 '07 #4

P: n/a
Thanks Tom that worked!

Steves
StevesATeyeDASHimagingDOTcom

Tom van Stiphout wrote:
On 19 Jan 2007 09:59:28 -0800, "steves" <st************@sbcglobal.net>
wrote:

You could enhance this query with:
Select <5 fields>, "Table1" As FromTable from Table1
UNION
Select <5 fields>, "Table2" As FromTable from Table2

Now the FromTable column will tell you where each row came from.

-Tom.
So,

If I perform a UNION query on my two tables, does the resulting dataset
have an "AutoID" field that I can use as a foreign key in my "Phone
Calls" table, which will point me to the correct row?
Tom van Stiphout wrote:
On 16 Jan 2007 20:08:00 -0800, "steves" <st************@sbcglobal.net>
wrote:

That's what UNION queries are for:
Select <5 fieldsfrom Table1
UNION
Select <5 fieldsfrom Table2

-Tom.
Hello All,

I am trying to link to an existing database and extend the
funcitonality by adding a phone call logging extension, so you can see
a list of phone calls for a given customer.

There are two similar address tables (USA and international), which are
almost the same except for some shipping addresses. The fields I'm
interested in are all the same. So, I have:

TABLES:
tblAddress (linked)
tblAddressInternational (linked)
tblPhoneCalls (new)

FORMS:
FormAddress - based on tblAddress - shows customer specifics
FormPhoneCalls - based on tblPhoneCalls - shows details of a call.
FormCallsByCustomer (main uses tblAddress, Subform uses
tblPhonecalls)

Currently, the tblPhoneCalls stores a foreign key to identify the
customer in the tblAddress. I can pretty much do everything I want with
US users, but can't see the international users.

SOOO - What I am wondering, is, is there any way that I can generate a
query that will combine the two similar address tables into a single
table, and base my FormCallsByCustomer on that.

It seems to me that I can create such a table, but I have trouble
conceiving of what foreign key is inserted in the tblPhoneCalls to keep
track of it, and whether I will have problems due to the tblAddress and
tblAddressInternational having new records added at different times.

Thanks in advance.
Steves
stevesATeyeDASHimagingDOTcom
Jan 23 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.