Populate Textbox from a combobox

S

sqlnewbie09

Need help fast!!

Have a form form for a student's weekly calendar schedule. Monday to Friday
with 10 class periods each.

Originally have 50 comboboxes to complete 1 student schedule for the whole
week.
This tremendously slows down my form.

Instead I converted it to 50 textbox controls. When a user clicks it, a
popup form will appear with 2 unbound comboboxes. First combo is for the days
of the week
and second contains the available courses (courseid, course_description)
entered to another form.

On the afterupdate event of the 2nd combobox:
I have a code to populate the textbox with the course_id which is bound to
TblSchedule. No problem here.
However data entry staff would like to see the course description and I need
it on a report as well instead of the course id.

How can I display the course description? For now, I have 2 textboxes for
each class period, 1 bound and another unbound with a Dlookup function. But
it will also defeat the purpose of making my forms faster. Also the popup
form will be used for all the 50 textboxes. What would be the best approach
to this dilemma??

TIA,
sqlnewbie09
 
A

Al Campagna

sqlnewbie09,
If you continue with this design, you will have many problems down the
road. You've already experienced...That's because the design is flawed...
You're not taking advantage of the power of a "realtional" database.
For example: Given your design, if you needed to know what students are
taking Latin101, you'll have to examine all 50 fields for each student, for
that value.

You really should have a tblStudents (the ONE) related to a tblClasses
(The MANY) by a key field such as StudentID.
Your main form would be based on tblStudents, with a continuous subform
based on tblClasses. One student, many classes.

It's beyond the scope of newsgroup emails to describe, in detail, "how
to build a realational database application." But, give my suggestion
strong consideration, and if/as you come across specific problems, please
post back.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
B

banem2

Need help fast!!

Have a form form for a student's weekly calendar schedule.  Monday to Friday
with 10 class periods each.

Originally have 50 comboboxes to complete 1 student schedule for the whole
week.
This tremendously slows down my form.

Instead I converted it to 50 textbox controls.  When a user clicks it, a
popup form will appear with 2 unbound comboboxes. First combo is for the days
of the week
and second contains the available courses (courseid, course_description)
entered to another form.

On the afterupdate event of the 2nd combobox:
I have a code to populate the textbox with the course_id which is bound to
TblSchedule.  No problem here.
However data entry staff would like to see the course description and I need
it on a report as well instead of the course id.

How can I display the course description?  For now, I have 2 textboxes for
each class period, 1 bound and another unbound with a Dlookup function.  But
it will also defeat the purpose of making my forms faster.  Also the popup
form will be used for all the 50 textboxes.  What would be the best approach
to this dilemma??

TIA,
sqlnewbie09


One solution is to make those text boxes hidden and place new 50 text
boxes.

Now, keep you solution, but populate hidden text boxes with ID and
visible text boxes with real description (lstName.Column(1)).

However, consider advice from Al.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
S

sqlnewbie09

Thank you both for your replies. I believe changing the design would be the
best approach as I would need to produce reports down the road.

Best,
sqlnewbie09
 

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