How to bind recordset to subform in access 2003 Parent Form

  • Thread starter Francisco Cortes
  • Start date
F

Francisco Cortes

--
Francisco Cortes
Computer Programming Student

Hi
background:
I'm new to VB (I've done some programming in C#)...

Type of Database being developed:
Access 2003 (Student Grading System: student info, subjects, levels,
classrooms, teachers, indicators and achievements(last 2 is what is
evaluated: meaning students either get approval on the indicator or not, and
several indicators compound an achievement), etc)

What I'm currently developing:

I'm working on an Access 2003 form to assign indicator approval to a list of
students that are part of classroom group. The form should show the following:
1. Text fields: Class, subject, achievement and indicator being graded (done
and working)
2. A combolist populated with classrooms according to the class (done and
working)
2. a button that would take the classroom selected (from the combolist) and
after is clicked, a "table/Grid" with students from that classroom selected
(studentID, name, lastname AND a Approval column approval to indicate if the
student passed the indicator (check mark) or not (no check mark). This table
comes from recordset generated dinamically
3. a button that should update a table with the information from the
"table/grid" Once the "table" shows the students who passed (have the check
mark on the approval column).

Problem:
I'm stuck on number 2:
WHAT I HAVE:
I have the recorset ready with the info I need (studentID, name, lastname
and approval) with some sample records to work with. (this record set gest
generated and populated fine)
WHAT I DON'T HAVE (PROBLEM):
I need to bind this recordset to some datagrid/datasheet subform that could
show the information from the recordset I have ready.
WHAT I HAVE TRIED:
1. I have tried to bind an unbound subform from VB code but it just wouldnt
let me:
me.UnboundSubform.SourceObject = recordset ->> I get an error saying object
property not supported or something like that.
2. On some thread I found someone suggests that I need to bind the subform
and change the recordsource dinamically from VB (I couldnt figure out how to
do that, as:
Me.UnboundSubform.Form.RecordSource = recordset --->>.. would also give an
error
3. another thread suggested to bind the subform to a table and in vb add the
records from the recordset onto the table but the problem is I need to
pupulate the table after clicking on the button so the table needs to have
records added dinamically. This doesnt happen that way if the subform is
bound from the beginning. what I get when I tried this is a subform that
shows records as the parentform is loaded and not when the button on the form
is clicked.

MY THOUGHTS ON POSSIBLE SOLUTIONS:
1. Is there a datagrid control in Access 2003 or something similar? in VS
this would've been the most convenient method to do it.
2. Is there an event I could work with on the subform that I could
manipulate so no binding takes place until user clicks the button so records
are added dinamically from the recordset generated?

Thanks for your help! (I've been stuck for 2 days already)
 
K

Ken Snell \(MVP\)

Set the subform's form's Recordset property to the created recordset.
 

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