How do i store ID into the table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Could you please suggest me for my below problem.

I need to store id into the table.

For example...

There are two table viz,. Stud_info_table, Stud_mark_table.

In the stud_info_table, the fields are Stud_id,Stud_roll_no,
Stud_name,Stud_add1,Stud_add2,Stud_city,Stud_state.

In stud_mark_table, the fields are stud_id,Mark_1,Mark_2, Mark_3,.

Here, When i enter data into the table, I need to call by stud_name in place
of
stud_id, but the stud_id need to store into the table instead of stud_name.

And, the same id which is stored in stud_mark_table need to call by
stud_name when i required.

How can i do this...?

Thnx in advance...
 
hi,
Here, When i enter data into the table, I need to call by stud_name in place
of
stud_id, but the stud_id need to store into the table instead of stud_name.
Your [Stud_ID] is an autoincrement value?

If so, you need to have another candidate key to query your ID, e.g. if
your student is unique by name and state:

=DLookup("Stud_ID",
"Stud_Info_Table",
"Stud_Name='solar' AND Stud_State='Bavaria'")


btw, what is your concrete problem? What have you already as solution?


mfG
--> stefan <--
 
Hi..

Thanks steffan...

Actually, my problem is simple. But, i am not able to find solution as i
have little knowledge abt database.

Before i explain my problem, I would like to get suggestion whether my
structure is correct or not.

i have 6 tables called Account table, Region table,Employee table,Vendor
table,Requisition table and Payment table.

In each table i have stored id which is autonumber field type.

And, in Account table and Region table, i have only name field with Id. So,
The total fields are two in each table.

And, In Employee table and Vendor table, i have one field called Region_id
to assign each employee & Vendor's region.

Is it correct or not ?

Is there anyway to assign each employee & Vendor's name to store in those
table viz Employee table,Vendor Table ?

Pls. suggest.

Thnx in advance.

ngrsolar.

Stefan Hoffmann said:
hi,
Here, When i enter data into the table, I need to call by stud_name in place
of
stud_id, but the stud_id need to store into the table instead of stud_name.
Your [Stud_ID] is an autoincrement value?

If so, you need to have another candidate key to query your ID, e.g. if
your student is unique by name and state:

=DLookup("Stud_ID",
"Stud_Info_Table",
"Stud_Name='solar' AND Stud_State='Bavaria'")


btw, what is your concrete problem? What have you already as solution?


mfG
--> stefan <--
 
hi,
Actually, my problem is simple. But, i am not able to find solution as i
have little knowledge abt database. [..]
Is it correct or not ?
Seems to be alright.
Is there anyway to assign each employee & Vendor's name to store in those
table viz Employee table,Vendor Table ?
?

You can use ComboBoxes on your forms. Set the ControlSource to the
corresponding ID. Assign the RowSource.

E.g. for Region

Data properties:
ControlSource = "Region_ID"
RowSource = SELECT ID, [Name] FROM Region
BoundColumn = 1

Format properties:
ColumnCount = 2
ColumnWidths = 2;2



mfG
--> stefan <--
 
HI,

Well, Its working fine. But, I dont need to show employee_id, as the user
not able to confirm what the region_name has stored at the time of saving the
record.

So, I tried to store by using Dlookup function with one more combox box
which displays Region name. And, in the Id combox box i used Dlookup as
below. And, I made it as invisible so that people dont need to get confusion.
It working fine.

=DLookUp("Region_id","Region_Table","Region_Name=" &
[Form]!Employee_Creation![Region_Name])

But, instead placing one more combo box,the same function why should i not
use in query. Like,I select region table where the field is only Region name.
And, under the criteria i used the Dlookup function as below.

=DLookUp("Region_id","Region_Table","Region_Name"="&
[Form]![Me]![RegionName]")

It would help to call even for Vendor_table also as i mentioned already.
But,its not working.

Can we do like this..? Is it possible...?

Pls.suggest me.

Thnx....in..advance.



Stefan Hoffmann said:
hi,
Actually, my problem is simple. But, i am not able to find solution as i
have little knowledge abt database. [..]
Is it correct or not ?
Seems to be alright.
Is there anyway to assign each employee & Vendor's name to store in those
table viz Employee table,Vendor Table ?
?

You can use ComboBoxes on your forms. Set the ControlSource to the
corresponding ID. Assign the RowSource.

E.g. for Region

Data properties:
ControlSource = "Region_ID"
RowSource = SELECT ID, [Name] FROM Region
BoundColumn = 1

Format properties:
ColumnCount = 2
ColumnWidths = 2;2



mfG
--> stefan <--
 
hi,
Well, Its working fine. But, I dont need to show employee_id, as the user
not able to confirm what the region_name has stored at the time of saving the
record.
Set

ColumnWidths = 0;2

then it will not be displayed.


mfG
--> stefan <--
 
Yeah..its simply great....

Well, Can u pls answer my "Data list" question which i posted
today(29/03/07) under "Access database programming".

Thanks in advance..

ngr.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top