A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conect a table with 2 columns from another table



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2008, 03:37 PM posted to microsoft.public.access.tablesdbdesign
Rictus
external usenet poster
 
Posts: 1
Default Conect a table with 2 columns from another table

Hi all,

I am somewhat new in this so any help will be highly appreciated:

Problem:
I have a large number of objects that may be of type: A, B or C and subtypes
a1, a2, a3, b1, b2 where a1,a2,a3 can be associated only to object of type A
and so on...

If I have a table with this 2 columns
A a1
A a2
A a3
B b1
B b2
C
and another table where I want to have 3 columns:
Object1 A a2
Object2 B b1
....
ObjectX A a3
what kind of linkage should I do in order to able to select subtypes a1, a2,
a3 only for objects that have type A and so on...

Since my English is not so great I hope I was able to explain the problem in
the right way.

And like I already mentioned: any help will be highly appreciated. :-)

Thanks guys!
  #2  
Old November 20th, 2008, 01:38 AM posted to microsoft.public.access.tablesdbdesign
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default Conect a table with 2 columns from another table

Hi Rictus,

Try this:

Using form named "Form6" with combo boxes named "cbTypeCode" and
"cbSubTypeCode". Row source of cbTypeCode is:

SELECT [tblTypeCodes].[TypeCode] FROM [tblTypeCodes] ORDER BY [TypeCode]

It has an on change ever that does:

cbTypeSubCode.Requery

Row source for cbSubTypeCode is:

SELECT tblTypeSubCodes.TypeSubCode FROM tblTypeSubCodes WHERE
(((tblTypeSubCodes.TypeCode)=[Forms]![Form6]![cbTypeCode])) ORDER BY
tblTypeSubCodes.TypeSubCode;

You may also need to clear cbSubTypeCode's value in the on change event
so that when someone selects A and a1 and then changes the type to B the
subtype does not remain at a1:

cbTypeSubCode.Value = Null

If nulls are not allowed, you may need to set it to the first value in
the list:

cbTypeSubCode.Value = cbTypeSubCode.Column(0, 0)

Hope this helps,

Clifford Bass

"Rictus" wrote:

Hi all,

I am somewhat new in this so any help will be highly appreciated:

Problem:
I have a large number of objects that may be of type: A, B or C and subtypes
a1, a2, a3, b1, b2 where a1,a2,a3 can be associated only to object of type A
and so on...

If I have a table with this 2 columns
A a1
A a2
A a3
B b1
B b2
C
and another table where I want to have 3 columns:
Object1 A a2
Object2 B b1
...
ObjectX A a3
what kind of linkage should I do in order to able to select subtypes a1, a2,
a3 only for objects that have type A and so on...

Since my English is not so great I hope I was able to explain the problem in
the right way.

And like I already mentioned: any help will be highly appreciated. :-)

Thanks guys!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.