StudentID changes by inputing data in a form

  • Thread starter Rasoul Khoshravan Azar
  • Start date
R

Rasoul Khoshravan Azar

I have three tables as follows:

StudentTbl
StudentID [pk]
StudentName
othre fields

CourseTbl
CourseID [pk]
CourseName
othre fields

UnitSelectionByStudentsQry
all fields of two tables

UnitSelectionByStudentsTbl (based on above query)
StudentID
CourseID
CourseScore

I input student name and course name in their relevant tables.
Now I want to make a form for course allocation for each student. I want the
form to bring the students name in a combo box and I select the course name
through a list box. ( Two (more) records may have same student name but
differemnt course name as one student can choose more than one course in one
semester).
I put the control source to studentTbl and courseTbl and put their row
source to field name in relevant forms.

It works but what is strange is that studentID and courseID change each time
I add a record. What is the problem? As far as I eneter data by their ID
numbers, no problem occures but trying to enter through the names makes it
work wrong.
 
J

Jeff Boyce

Is there a chance that one/more of the underlying tables is using a "lookup"
data type field?

Regards

Jeff Boyce
<Office/Access MVP>
 
R

Rasoul Khoshravan Azar

Sorry but I dont know what is lookup data type is? I store student names and
course names in separate tables and join them through a query, so that I can
enter the combination in the form. Is this enough?
Jeff Boyce said:
Is there a chance that one/more of the underlying tables is using a "lookup"
data type field?

Regards

Jeff Boyce
<Office/Access MVP>

Rasoul Khoshravan Azar said:
I have three tables as follows:

StudentTbl
StudentID [pk]
StudentName
othre fields

CourseTbl
CourseID [pk]
CourseName
othre fields

UnitSelectionByStudentsQry
all fields of two tables

UnitSelectionByStudentsTbl (based on above query)
StudentID
CourseID
CourseScore

I input student name and course name in their relevant tables.
Now I want to make a form for course allocation for each student. I want
the
form to bring the students name in a combo box and I select the course
name
through a list box. ( Two (more) records may have same student name but
differemnt course name as one student can choose more than one course in
one
semester).
I put the control source to studentTbl and courseTbl and put their row
source to field name in relevant forms.

It works but what is strange is that studentID and courseID change each
time
I add a record. What is the problem? As far as I eneter data by their ID
numbers, no problem occures but trying to enter through the names makes it
work wrong.
 
J

Jeff Boyce

Open the tables in design mode. Inspect the data types of the fields. Are
any of those "Lookup"?

Regards

Jeff Boyce
<Office/Access MVP>

Rasoul Khoshravan Azar said:
Sorry but I dont know what is lookup data type is? I store student names
and
course names in separate tables and join them through a query, so that I
can
enter the combination in the form. Is this enough?
Jeff Boyce said:
Is there a chance that one/more of the underlying tables is using a "lookup"
data type field?

Regards

Jeff Boyce
<Office/Access MVP>

Rasoul Khoshravan Azar said:
I have three tables as follows:

StudentTbl
StudentID [pk]
StudentName
othre fields

CourseTbl
CourseID [pk]
CourseName
othre fields

UnitSelectionByStudentsQry
all fields of two tables

UnitSelectionByStudentsTbl (based on above query)
StudentID
CourseID
CourseScore

I input student name and course name in their relevant tables.
Now I want to make a form for course allocation for each student. I
want
the
form to bring the students name in a combo box and I select the course
name
through a list box. ( Two (more) records may have same student name but
differemnt course name as one student can choose more than one course
in
one
semester).
I put the control source to studentTbl and courseTbl and put their row
source to field name in relevant forms.

It works but what is strange is that studentID and courseID change each
time
I add a record. What is the problem? As far as I eneter data by their
ID
numbers, no problem occures but trying to enter through the names makes it
work wrong.
 

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

Top