Computing.Net > Forums > Windows XP > access question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

access question

Reply to Message Icon

Name: bonjamon
Date: March 10, 2004 at 13:51:43 Pacific
OS: xp/office 98
CPU/Ram: 2800 athlon/1024mb ddr
Comment:

I have just realised that I cannot link the same identifier across two tables where in each table it is the primary key for two types of property, residential and commercial.
The problem arising from this is that my viewings table now has to have two fields for ID, and a field to distinguish the property being viewed as either commercial or residential. As the property can only be one I would like the database to allow you only to enter into the correct field, for example if a property is Commercial, and has the Commercial PropertyID of 12345, then the table should only allow you to enter the data into the corresponding field, and not allow you to enter it into the ResidentialPropertyID field.

Is there a way of doing this, would it be through use of an IF statement? The database will be using forms to enter, edit and view information. Your help is much appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: kinel
Date: March 10, 2004 at 14:21:51 Pacific
Reply:

Think you're in the wrong forum for this.

Try Office Software


0

Response Number 2
Name: Scouseknight
Date: March 10, 2004 at 14:23:23 Pacific
Reply:

Do the CommercialPropertyID and ResidentialPropertyID reference other tables (as in one for commercial and one for residential)?

I would have a rethink if so - perhaps have one table containing both commercial and residential, and have a flag on this table to distinquish them both - therefore using only one ID field which can be changed to a lookup table instead - this way, you can have a different form for Commercial and Residential, and have the lookup tables bind to Queries instead, a query named ResidentialQry which selects only those records where the property type is Residential, and a query named CommercialQry with the equivalent for the Commercial properties.


0

Response Number 3
Name: bonjamon
Date: March 10, 2004 at 15:09:48 Pacific
Reply:

yes they do link to other tables.
the problem is a significantly different amount of data needs to be stored on commercial and residential properties.
I think I am going to have a Res Properties ID and Com. properties ID.


0

Response Number 4
Name: Scouseknight
Date: March 10, 2004 at 15:14:36 Pacific
Reply:

A way around this is to store the "base" information - as in the information that is the same on both types of property, and then further link to a secondary table for the additional information.

Query definitions can handle the table linking behind the scenes which makes life a heck of a lot easier - it's as if they are in one table.

I usually only use Access to create tables and querydefs - I normally have Visual Basic or ASP.NET to handle all the clever stuff so apologies if I am a little set in my ways!

As the other fella said up there try in the Office Software and also Programming forums as well.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: access question

stupid Remote Access question www.computing.net/answers/windows-xp/stupid-remote-access-question/158997.html

MS Access 2000 Premium w/ Office XP SBE www.computing.net/answers/windows-xp/ms-access-2000-premium-w-office-xp-sbe/29610.html

Access checkbox www.computing.net/answers/windows-xp/access-checkbox/172165.html