Combo Box with multiple selection in text boxes

D

Daoud Fakhry

All masters,
I know this is very basic question. I have searched alot but couldn't get
what I need. I have a table with the following info:

HolidayTable:
- ID
- Date
- Purpose of Holiday
- Type

I have another table named Overtime where I want to keep the employee
overtime records in details. One employee might work overtime on 5 different
holidays in a month and different hours in a holiday.

OvertimeTable:
- ID
- EmployeePIN
- Date
- Purpose of Holiday
- Type
- Hours Worked

I want to creat a form where I have a combo box selecting ID or EmployeePIN
and then I should have 5 more text boxes which preview the data based on the
selection of the combo box. My combo box should retriev data from
HolidayTable. there should be more than one combo box for different holidays
and hours worked as overtime. At the end I want to update the same
information I have selected from a combo box and the rest data displayed by
text boxes should be updated into overtime table for my later use. I need to
have a detailed information of which date an employee worked and how many
hours.

Is there any one to post me back on this regard. I appreciate your
cooperation in advance.

Thanks, Daoud Fakhry
 
K

Ken Snell \(MVP\)

It's not clear why you would need/want more than one combo box for the
Holiday table information? I would think that you'd want to see/edit/review
the data for just one Holiday at a time? Otherwise, the form will become
unwieldy if you're trying to view multiple records of data and edit/view
them at the same time?

Or perhaps you could just use a continuous forms view for the form, and see
all the Holiday records for the chosen employee at one time? Then you can
edit/review the separate data because each record will contain one holiday's
information.
 
D

Daoud Fakhry

Dear Ken,
The reason that I want to have more than one combo box is that most of the
time it happens that one employee works 5 different holidays in a month.
Please hele me on how to proceed to have the following job done. Thanks.
 
J

John W. Vinson

Dear Ken,
The reason that I want to have more than one combo box is that most of the
time it happens that one employee works 5 different holidays in a month.
Please hele me on how to proceed to have the following job done. Thanks.

Daoud, are you storing information about each holiday (or each day worked) in
a differernt *FIELD* in your table? If so, that's the problem! You should have
a different *RECORD* instead. How are your tables structured?
 
D

Daoud Fakhry

Hi John,
If you see my first treat, it shows all the details of my tables. I am
storing each holiday in a different record not in a field.

I have one table named HolidaySchedule (see the fields in my original treat)
which is stored the holidays during a month or a year. then I have a nother
table named overtime (see my original treat for details) which I need to
store employees holidays worked during a month or year. an employee might
work more than one day (one holiday during a month, so I want to use a combo
box in a from to retrieve the data from Holiday Schedule, so when I pick a
holiday from a combo box, the rest columns of the Holiday schedule should
show up in the text boxes which I have in the form to show the (purpose of
holiday, type and other fields). After I should be able to store the
information my overtime table.

Any help in this regard is much appreciated. Thanks - D
 
J

John W. Vinson

Hi John,
If you see my first treat, it shows all the details of my tables. I am
storing each holiday in a different record not in a field.

I have one table named HolidaySchedule (see the fields in my original treat)
which is stored the holidays during a month or a year. then I have a nother
table named overtime (see my original treat for details) which I need to
store employees holidays worked during a month or year. an employee might
work more than one day (one holiday during a month, so I want to use a combo
box in a from to retrieve the data from Holiday Schedule, so when I pick a
holiday from a combo box, the rest columns of the Holiday schedule should
show up in the text boxes which I have in the form to show the (purpose of
holiday, type and other fields). After I should be able to store the
information my overtime table.

Daoud, I use Agent to connect to the newsgroups. I read about 150 or 200 posts
a day, and answer quite a few of them.

You're not the only person posting here, by far. It's rather rude of you to
suggest that I should bring up Google Groups and search through the archives
to find your previous post.

Since you do presumably have that information available, would you please
repost it?
 
D

Daoud Fakhry

Hello John,
I am sorry requesting you to find my original post, I aplogize for that.
Below you can find original post.

All masters,
I know this is very basic question. I have searched alot but couldn't get
what I need. I have a table with the following info:

HolidayTable:
- ID
- Date
- Purpose of Holiday
- Type

I have another table named Overtime where I want to keep the employee
overtime records in details. One employee might work overtime on 5 different
holidays in a month and different hours in a holiday.

OvertimeTable:
- ID
- EmployeePIN
- Date
- Purpose of Holiday
- Type
- Hours Worked

I want to creat a form where I have a combo box selecting ID or EmployeePIN
and then I should have 5 more text boxes which preview the data based on the
selection of the combo box. My combo box should retriev data from
HolidayTable. there should be more than one combo box for different holidays
and hours worked as overtime. At the end I want to update the same
information I have selected from a combo box and the rest data displayed by
text boxes should be updated into overtime table for my later use. I need to
have a detailed information of which date an employee worked and how many
hours.

thanks John,
 
J

John W. Vinson

At the end I want to update the same
information I have selected from a combo box and the rest data displayed by
text boxes

Displayed in textboxes is easy. You can put textboxes on the form with control
sources like

=cboHolidays.Column(n)

where cboHolidays is the name of the combo box control, and n is the zero
based index of the field you wish to display.
should be updated into overtime table for my later use.

Ummmm... No.

The Purpose of the Holiday is an attribute of the holiday table. It is not an
attribute of an overtime work! All you need to store in the Overtime table is
the HolidayID or in fact just the date of the holiday. You can easily create a
Query joining the overtime table to the Holidays table to pick up the other
information about the holiday. Could you explain why you feel it necessary to
copy data into the overtime table which would be redundant there, and which
could easily be looked up?
 

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