0

So lets say I have 3 tables.

LangTable

[id]    [Eng]    [Jap]
0       "Fire"   "ほのお"
...
12      "Water"  "みず"
13      "Math"   "Whatever"
...

this table is shared by dozzens of other tables, as it only holds the translations of the data for readability to the games user interfaces.

SomeData

[id]    [data]
0       0           
1       12          
...

Somedata displays as: (Working as of now)

[id]    [data]
0       "Fire"          
1       "Water"         
...

Fire is 0, in this db. but I don't list it directly.

Water is set as id 1, but its name is stored in another table because the name isn't important to the program directly.

SomeDataRelationship

[id]    [Somedata1]    [Somedata2]    [effectiveness]
0       0              0              1              
1       0              1              0
...

SomeDataRelationship displays as: (Not working)

[id]    [Somedata1]    [Somedata2]    [effectiveness]
0       "Fire"         "Fire"         1              
1       "Fire"         "Water"        0
...

In this last table im showing relationships between my "SomeData" the 0 shows that the SomeData.0 which means fire, is normaly effective agenst fire. And row 1 shows that somedata.0 which means fire, is useless agenst water which is somedata.1

But as for my question, this data stratigy works fine, and makes the game run fine, but its... Really hard to read directly if im inputting data to show new relations.

In access I seen something kinda similar where they used a query like this to show the names. In the look up i hide the id.

SELECT [LangTable].[ID], [LangTable].[Eng] FROM LangTable ORDER BY [ID], [Eng]; 

Which allows me to select "Fire" from the drop down menu in the access table, but the data saved is the actual numerical value.

Long story short, i'm trying to get the drop down menu of the relationship table to display "Fire". I know that i can use a look up and hide the id, but it doesn't seem to work across another table.

The end result should be that in the Langtable should be an id to word paring used by dossens of other tables.

The Somedata table should be comprised of numbers but display as words (Working already)

And the relationship table should be comprised of numbers aswell, but there numbers are the ids from the somedata table, but display as words from the lang table.

Steven Venham
  • 600
  • 1
  • 3
  • 18
  • Not really an answer, but is there a reason you're using an integer based surrogate key instead of a natural key? For readability unless you need duplicates in [Eng] I would use that field and store the actual values ("Fire", "Water", "Math") rather than the integer. An integer field typically takes up 2 bytes worth of space, whereas the word "Water" is only taking up 5 bytes. Unless you expect an extremely large number of items in [Eng], I would use the natural key instead. – gwhenning Oct 29 '14 at 19:05
  • @gwhenning currently my lang databace contains... 8 langs. and about 150 entrys. they range from a simple word, to multiple paragraphs. – Steven Venham Oct 29 '14 at 19:09
  • 1
    There is a `Column(index)` property that you can utilize. I am going to assume you set your dropdown to display the name, and hide the ID field? Is this is the case, you can use VBA to get the respective column you want. E.g: `Me.ComboBoxName.Column(0)` will give you the hidden column if it is the ID. – Mark C. Oct 29 '14 at 20:07
  • @Invent - Animate that fixed my middle problem, and i edited the post to refelct this, but the bottom one is still giving me problems. – Steven Venham Oct 30 '14 at 23:39

0 Answers0