set table to pull column from another table?

kefka95

New Member
Joined
Jan 13, 2010
Messages
13
I'm fairly new to Access, and I'm hoping this is an easy question! Let's say I have 10 tables, and 500 unique items. The first column of each of the 10 tables should always refer to the same list of 500 items (after the first column each of the tables has different fields). If I add or remove an item, the same change needs to happen on all 10 tables. This first column also needs to be the primary key in each table, if it matters.

Is it possible to have one table that simply contains the list of items, and the other tables automatically link to that table for that one field? Meaning I could add something one time and have it automatically show up on all 10 tables?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Perhaps you had better explain in PLAIN (and REAL) terms. Instead of using generics (I have 10 tables), tell us exactly what you have. I understand that you think that by simplifying it you are not going to confuse us and we could give you guidance. OR you could be having intrepidation around the likelihood that you have a non-normalized design and we'll call you on it.

Either way, we should know what you are REALLY dealing with so we can give you the BEST suggestions possible. We don't just give blind answers to a specific question if the question seems like the situation is potentially one which could be turned into "best practices."
 
Upvote 0
Perhaps you had better explain in PLAIN (and REAL) terms. Instead of using generics (I have 10 tables), tell us exactly what you have. I understand that you think that by simplifying it you are not going to confuse us and we could give you guidance. OR you could be having intrepidation around the likelihood that you have a non-normalized design and we'll call you on it.

Either way, we should know what you are REALLY dealing with so we can give you the BEST suggestions possible. We don't just give blind answers to a specific question if the question seems like the situation is potentially one which could be turned into "best practices."

Thank you for the response Bob. I'm probably just showing my ignorance here, but I'm not sure how to go about being more specific. It could just be that I don't know the right terminology to explain it? I'm not trying to oversimplify it - I guess I'm just explaining it the only way I know how. In any case, I'll try to clarify as best I can:

The only fields any of the tables contain are number and text fields. The name and the type of the fields are the only things I have changed - any other settings or properties are whatever they are by default on a standard Office installation.

The main purpose of the database itself is to simply store data. The speed or performance of the database is not a primary concern. As long as it can store the data and allows me to modify the data relatively painlessly, it will meet my requirements. Any modifications made to the data in the tables will be done manually by me from within Access - no other external application or database will ever modify any piece of it (with the possible exception explained below).

If nothing else I can just maintain the data in Excel (which I know inside and out) and simply import into Access when finished, but I would prefer to do it directly in Access if it's feasible.

That's probably about all I can tell you about it. If you need more specific information, please let me know what type of information you need, and I will do my best to provide it.
 
Upvote 0
I don't understand, if you are using Access to store this data surely the speed, accuracy, ease of use is of some concern?

That last one 'ease of use' and your mention of 'modify...painlessly' would probably be helped if you organised the data just a little bit.

For example, how are you going to locate data if it's spread over 10 tables?

Also if you are using Access for storage extracting data might not be to straightforward with this setup.:)

This is all kind of based on what information you've given so far.


All you've said so far is you have tables with fields in Access and you want to link them somehow, maybe.

Perhaps with further information it'll make more sense.

What sort of information would help?

Perhaps something about what information/data you are working with, how you want to link thngs, eg why is X linked to Z, and Y linked to G
 
Upvote 0
I don't understand, if you are using Access to store this data surely the speed, accuracy, ease of use is of some concern?

That last one 'ease of use' and your mention of 'modify...painlessly' would probably be helped if you organised the data just a little bit.

For example, how are you going to locate data if it's spread over 10 tables?

Also if you are using Access for storage extracting data might not be to straightforward with this setup.:)

This is all kind of based on what information you've given so far.


All you've said so far is you have tables with fields in Access and you want to link them somehow, maybe.

Perhaps with further information it'll make more sense.

What sort of information would help?

Perhaps something about what information/data you are working with, how you want to link thngs, eg why is X linked to Z, and Y linked to G

Ok, let me try again. I have to apologize, as I only rarely work with Access, and so I'm not familiar with what information is generally needed to answer these types of questions. You're also correct that I forgot to mention how the data is pulled from the database.

So here is a much more specific explanation. Some of this is probably not directly relevant to the original question, but I'll try to make sure and give too much rather than not enough information this time. This is what I was trying to avoid having to explain with the first few posts, but you asked for it :biggrin:. Don't worry, I'll get to the point of having the database eventually :rolleyes:.

I develop and maintain a program called TweakMB for the Mount & Blade series of PC games. Much of the code for the Mount & Blade games runs off of values contained in certain text files, which are built from compiled python script. Because these values are stored and read from plain text files, users can easily modify, or "tweak", values that impact things that happen ingame, if you know where to look in the file. This could be anything from the number of troops you can have in your army, to the amount of gold you earn from completing tasks, to adding completely new functionality to the game.

The purpose of TweakMB is to handle these tweaks automatically for the user. The code in the text files looks something like this " 89 21 1 144115188075856273 22 1 144115188075856786 2204 2 144115188075856787 144115188075856273 ", except there are thousands of lines of it, and each line can contain tens of thousands of values. As you can imagine, your average player doesn't want to mess with trying to figure out which one of these thousands of values represents "renown gained from winning a tournament", or whatever the tweak may be. There's also the risk of messing up your game if you make a bad modification. TweakMB knows exactly where each of these values is located, and can modify the text file automatically based on whatever value the user enters for a given tweak.

So getting to the purpose of the database...TweakMB can perform hundreds of these "tweaks". Each of the tweaks has about 10 "properties" associated with it in TweakMB, such as the name of the file that contains the tweak, the exact field number that contains the tweak value in the line, the name of the control within TweakMB, a detailed description of the tweak (in multiple languages), and so on and so forth.

Currently all of this data is "hardcoded" into TweakMB itself, meaning there are tens of thousands of values scattered all over the place in the code. As you can imagine, this has become a pain to deal with. My goal for the next major version of TweakMB is have the bulk of the tweak properties stored in a structured fashion in a database, at which point the program can pull the data from the database and handle it however it needs to. If it matters, TweakMB is written in VB.NET using Visual Studio 2008.

So your first question is probably why don't I just set up one big table with the records representing each unique tweak, and the columns representing each property of that tweak. The answer is that TweakMB also supports these tweaks for numerous user mods as well as the original game. The Mount & Blade games are designed to be very modder-friendly, and there are many great mods available for it. However, the properties for each tweak are potentially different with each mod, and must be stored separately for each version of each mod.

Finally, the database is setup as follows:

Each table represents one of the properties of the tweaks (ie, filename, description, default value, etc)

Each record within the tables represents a unique tweak, and each one of these tweaks has to be represented in every table

Each column within the tables represents a specific user mod

The reason that the tables are setup by tweak property instead of being setup by user mod is that when I'm updating the values, it helps to be able to see at a glance which values were previously used for other mods or game versions.

When it's set up this way, I can create a simple query to pull in the records for any given individual mod, which is all that needs to happen as far as TweakMB is concerned. For example, if I need to pull the tweak properties for all 500 tweaks for the mod "Native 1.143", all I have to do is pull the "Native 1.143" column from each table. The first column in each table is the "Tweak ID" column, which is what identifies each specific tweak and is also what ties the tables together in the query.

The reason I say that speed is not important is that TweakMB accesses the database a total of one time each time it runs. It connects to the database, determines which pre-built query should be used for the mod the user selected, and then pulls the entire query into a DataTable object in memory. The database itself is never touched again after that one time. No part of it is ever modified by TweakMB. Even with the probably non-ideal way I have it setup now, this part of the process still happens pretty much instantaneously, which is why I'm not terribly worried about speed.

So after all that, back to the original dilemma. This is what I want to accomplish with this database:

Store the appropriate data --> done and ready to go
Easily consolidate the appropriate data with a query --> done and ready to go
Ability to retrieve queried data using VB.NET application --> done and ready to go
Ability to easily add new tweaks to the database when needed --> not done

Currently if I want to add a new tweak, I have to manually go into each of the 10 tables and add the same Tweak ID to each table. This annoys me. What I'm looking for is a way to have all of the Tweak IDs stored in one central location, and then have the other 10 tables setup in a such a way that they automatically pull the Tweak ID values from this one central location. This way I only ever have to add a new Tweak ID one time, and I can be assured it's added in the same way on each table. I would still have to manually modify the actual tweak property values specific to each table, but there's no getting around that.

Anyway, if you read all that and you're still paying attention, I salute you. If you fell asleep a long time ago, I don't blame you :laugh:.
 
Upvote 0
Well if by central location you mean table that would probably be a start, ie a tweak ID table.

Then I can see a mod table and a single tweak table.

The mod table would 'just' be a list of all the mods.

That would be a start and it might be where your at.

The main problem is the multiple tables for each property of the tweaks.

That's just not right, especially when the tables seem to be almost identically structured and share the same Tweak ID.

I'll need to go through your posy again to clarify the full mod/tweak thing.
 
Upvote 0
Well if by central location you mean table that would probably be a start, ie a tweak ID table.

Then I can see a mod table and a single tweak table.

The mod table would 'just' be a list of all the mods.

That would be a start and it might be where your at.

The main problem is the multiple tables for each property of the tweaks.

That's just not right, especially when the tables seem to be almost identically structured and share the same Tweak ID.

I'll need to go through your posy again to clarify the full mod/tweak thing.

Sorry for the long and confusing post! If I didn't give the entire backstory, then nothing else I say about "tweaks" or "mods" would make any sense to anyone but me!

I agree that it feels awkward to have separate tables for each property. The more I think about it, it seems like it would be more logical to have a separate table for each mod, with the tweak properties setup as the columns.

If configured that way, it wouldn't even be necessary to have any queries - the application could just pull in the appropriate table directly.
 
Upvote 0
This is probably a very stupid question considering the amount of data you probably have, but could you post some sample data?

I think I get it but some bits are still a bit puzzling.

For example, can a weak change for each mod?

Say there's a tweak to increase skill or something, are the parameters/values of the tweak the same for all mods or are they different for some (all) mods.

eg Tweak X for mod Y changes Z value in file FL1 but for mod T the change is A in file FL2.

Does that make any sense whatsoever?
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top