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

How to make database on this?

100+
P: 180
How to make database with this;
Field name is [METHOD] then under [METHOD] there are selection of [METHOD1], [METHOD2, [METHOD3]
then under [METHOD1] there is a value [1,2,3] then in [METHOD2] there is also a value of [1,2,3] and also for the [METHOD3]

this is the output (disregard the arrow):

Expand|Select|Wrap|Line Numbers
  1. METHOD --> METHOD1    METHOD2    METHOD3
  2.               1          1          1
  3.               2          2          2
  4.               3          3          3
Jan 22 '15 #1

✓ answered by NeoPa

Looking at your data further I have a basic understanding that Method probably refers to a specific process or experiment done with a single element (at a time at least).

For this you would need a table of methods (tblMethod), a table of elements (tblElement) and a table of results which linked to both the element and the method (tblResult). tblElement & tblMethod would then be considered parents of tblResult so that each tblResult record had links to both tblElement and tblMethod.

At its most basic this might look like :

Expand|Select|Wrap|Line Numbers
  1. Table=[tblElement]
  2. ElementID    AutoNumber & PK
  3. ElementName  String
Expand|Select|Wrap|Line Numbers
  1. Table=[tblMethod]
  2. MethodID     AutoNumber & PK
  3. MethodName   String
Expand|Select|Wrap|Line Numbers
  1. Table=[tblResult]
  2. ResultID     AutoNumber & PK
  3. ElementID    FK (tblElement)
  4. MethodID     FK (tblMethod)
  5. ResultVal    Double

Share this Question
Share on Google+
12 Replies


NeoPa
Expert Mod 15k+
P: 31,769
I fixed your layout problem but I still have absolutely no idea what your question is asking for help with :-(
Jan 23 '15 #2

100+
P: 180
thank you for your reply Neopa, My question is how can I do that in creating a table. the METHOD is the field name, then the data fields are METHOD1, METHOD2 and METHOD3. then under them there are values 1, 2, 3
Can it be design in table or there is a way to do the sub datasheet?
Jan 23 '15 #3

NeoPa
Expert Mod 15k+
P: 31,769
Still no idea what it is you're asking for. Sorry.
Jan 23 '15 #4

100+
P: 180
is it possible to have a field name then under it there is a data field that will serve also as seconday field name then under it is the data field
example. field name
secondary field name
data field
Jan 24 '15 #5

NeoPa
Expert Mod 15k+
P: 31,769
A field in Access is similar to a column in Excel. This should not be confused with a control, which is an item on an object such as a form or report. Typically, controls can display data from available fields in Access.

I can see no scenario except one where your question makes any sense at all, and I'm trying hard to guess what it is you're talking about. The relationship of a field to its data is not flexible. There is a field and it contains data. That is one of the most basic concepts we are dealing with in databases anywhere.

However, if you mean control when you say field the first time but field when you say it the next time then it's conceivable you're asking if it's possible to have a control on a form that shows data from one field in certain circumstances but data from other fields in other circumstances. That is possible. You can change the relationship between a control and a field in design mode or even in code when the form is open.

I may still have misunderstood you completely, of course, but that's my best guess of what you're saying.
Jan 24 '15 #6

100+
P: 180
Thank you NeoPa, can I attach picture showing what i want to achieve? may an illustration?


The picture link above is the example I want to achieve in microsoft access table or form in datasheet view or single form. Is this possible to make in access?
Jan 30 '15 #7

NeoPa
Expert Mod 15k+
P: 31,769
I suspect that is possible. There is still too little information to describe exactly what you do want, and the design (If I understand you correctly at all) would not involve anything more complicated than tables and fields even so.

The trick would be to design the table and fields in such a way as to allow for the data you have to be presented.

The numbers you show have no value that they match in the left column - so that makes reading your mind a little tricky. Nor is there any explanation as to how the two separate string values in the top two rows relate to each other. One can assume that they both relate to all the numbers in the column below, but we're still left with many more questions than answers.

Hopefully though, it helps to say that such data can be stored and shown with an appropriate table/field structure. I just can't tell you what that is without a better understanding of your intended data structure.
Feb 1 '15 #8

NeoPa
Expert Mod 15k+
P: 31,769
Looking at your data further I have a basic understanding that Method probably refers to a specific process or experiment done with a single element (at a time at least).

For this you would need a table of methods (tblMethod), a table of elements (tblElement) and a table of results which linked to both the element and the method (tblResult). tblElement & tblMethod would then be considered parents of tblResult so that each tblResult record had links to both tblElement and tblMethod.

At its most basic this might look like :

Expand|Select|Wrap|Line Numbers
  1. Table=[tblElement]
  2. ElementID    AutoNumber & PK
  3. ElementName  String
Expand|Select|Wrap|Line Numbers
  1. Table=[tblMethod]
  2. MethodID     AutoNumber & PK
  3. MethodName   String
Expand|Select|Wrap|Line Numbers
  1. Table=[tblResult]
  2. ResultID     AutoNumber & PK
  3. ElementID    FK (tblElement)
  4. MethodID     FK (tblMethod)
  5. ResultVal    Double
Feb 1 '15 #9

100+
P: 180
Thank you Neopa, I have a better way now how to do it. Thanks alot
Feb 2 '15 #10

100+
P: 180
Neopa are these 3 tables have their own primary key? or only the tblResult must have the primary key?
Feb 2 '15 #11

NeoPa
Expert Mod 15k+
P: 31,769
tblResult is actually the only one of them where having a Primary Key (PK in the layout) is not essential.
Feb 2 '15 #12

100+
P: 180
Thank you again Neopa
Feb 2 '15 #13

Post your reply

Sign in to post your reply or Sign up for a free account.