PDA

View Full Version : need some help on how to update fields based on tab selection



keek2a4
09-12-2007, 04:11 AM
I am using an access database and am trying to solve this function; I am pretty new to access and can?t seem to figure out how to do it. Here is what I am trying to do

I have two tables called

1. tblExamType: in this table I have field called examTypeID as Primary Key
2. tblExamDetails: in this table I have a field called fkexamTypeID as a Foreign Key.

Now in my Students Form, I have a subForm that has three tabs called Maths, Science and English.

What I want is when the user Clicks Maths tab, the tblExamDetails form is displayed and when the user enters in the date, the hidden field fkexamTypeID should update itself to ?1? (this is only when the user enters the date)

If the user clicks the Science tab, the same tblExamDetails form is displayed but this time when the user enters in the date, the hidden filed fkexamTypeID should update itself to ?2?
In my tblExamType table i have fields examTypeID and examName so it looks like this

examTypeID examName
1 Maths
2 Science
3 English

and in the tblExamDetails table the field fkexamTypeID looks like this

fkexamTypeID
1
2
1
3
2

this is based on users selecting which tab from the student form. I hope its clear what I am trying to acheive.

I have no clue how to start coding this in VBA and would really appreciate any help or direction you could point me to.

Kind Regards,
Ket

stanl
09-12-2007, 04:23 AM
Homework? Class assignment?

keek2a4
09-12-2007, 05:27 AM
Hi! I am doing this for a group of friends who are teachers. My main task is to convert their excel spreadsheet into an access application so they can manage exam results effectively.

Ket

asingh
09-13-2007, 03:15 AM
Hi,

Is it possible you could post a stripped down version of the data base..which has your table structures..and forms...would like to give it a try..!

regards,

asingh

keek2a4
09-13-2007, 04:15 AM
Yea sure, I have sent you a ziped file of my database.

Kind Regards,
Ket