I have 1 dataset called "dataset1" that contains 2 tables called
"course" and "courseload".
in my form i have a datagrid. the datasource of this datagrid is
"dataset1" and the datamember is "courseload".
here's the fields of every table in my dataset.
"Course" table
CourseID
CourseCode
CourseDescription
Program
Year
"Courseload" table
CourseLoadID
CourseID
Grades
CourseID in course table is a primary key and CourseID in CourseLoad
table is a foreign key.
now my question is on how can i fill this datagrid w/ records from
course table based on the criteria like Program and Year.
example:
Course table
CourseID CourseCode Program Year
1 IT 1 BSIT 1
2 IT 2 BSIM 1
3 MATH 1 BSIT 2
so for example in my form i want to fill the datagrid w/ records from
course table that has Program = BSIT and Year = 1
so the datagrid now will have
CourseID Grades CourseLoadID
1
2
Note: I have already done this using MS Access but I ported my apps to
VB.NET
i use the Docmd.RunSQL command then the insert statement like this
one:
DoCmd.RunSQL "INSERT INTO CourseLoad ( CourseID) " _
& "SELECT Course.CourseID " _
& "FROM Course " _
& "WHERE Course.Program = " &
Forms![Students]![Program] & " AND Course.Year= " & Me!Year;
this is pretty simple w/ MS Access.
thanks in advance for any help.