combo boxes selection

  • Thread starter Thread starter mon
  • Start date Start date
M

mon

Hi, My form is to enter activities for jobs. There are 6
different types of jobs with different types of item
numbers for entries and I have 6 combo boxes. At the
moment I have all 6 radio buttons which when selected
choose the specific item Number drop down set. Then the
activity is entered. When I go to another job number I
have to choose the specific combo box again. I would like
to have the right combo box drop down when the job is
chosen. The job numbers come from a linked table. Help.
Mon
 
Hi, My form is to enter activities for jobs. There are 6
different types of jobs with different types of item
numbers for entries and I have 6 combo boxes. At the
moment I have all 6 radio buttons which when selected
choose the specific item Number drop down set. Then the
activity is entered. When I go to another job number I
have to choose the specific combo box again. I would like
to have the right combo box drop down when the job is
chosen. The job numbers come from a linked table. Help.
Mon

Code the AfterUpdate event of the control used to select the job
number:
Me![ComboName].SetFocus
Me![ComboName].Dropdown
 
If I understand right, you have an option group with 6 options and you want the corresponding combo box to automatically dropdown when an option is selected

I made an option group (frame0), with 6 options (Option1 thru Option6) that has option values 1 thru 6

I created 6 combo boxes, names combo1 thru combo6. The labels for the combo boxes I named Label_1 thru Label_6

In the afterupdate event of frame0, I entered this code

Private Sub Frame0_AfterUpdate(
Select Case Frame
'option 1
Case
Me.Combo1.SetFocu
Me.Combo1.Dropdow
' option
Case
Me.Combo2.SetFocu
Me.Combo2.Dropdow
' option
Case
Me.Combo3.SetFocu
Me.Combo3.Dropdow
' option
Case
Me.Combo4.SetFocu
Me.Combo4.Dropdow
' option
Case
Me.Combo5.SetFocu
Me.Combo5.Dropdow
' option
Case
Me.Combo6.SetFocu
Me.Combo6.Dropdow
End Selec
End Su

If you want to draw the eye to the combo box, add this code to each combo box, changing names to the proper combo box

'change the background color and fon
Private Sub Combo1_GotFocus(
Me.Combo1.BackColor = vbYello
' comment out the above line and
'uncomment the following line for a pale yello
'Me.Combo1.BackColor = 1271398
Me.Label_1.FontBold = Tru
End Su

'resets the background color and fon
Private Sub Combo1_lostFocus(
Me.Combo1.BackColor = vbWhit
Me.Label_1.FontBold = Fals
End Su

HT

Stev
 
Thanks for the colour formatting, How can I apply that to
change the view of individual records on a form ie red if
the due date is within a week of today's date or perhaps
black if the due date has passed and the job is not closed?

Re the combo boxes: I would like them to be linked to the
type of job: eg job number 50456 is jobtype 1. How do I
code the combo box 1 to drop down. The job number field
is a dropdown list from another table. So basically the
combo boxes do not need to show at all on the form. They
do at the moment because the selection has to be made with
each activity record entry. Thanks "heaps". mon

-----Original Message-----
If I understand right, you have an option group with 6
options and you want the corresponding combo box to
automatically dropdown when an option is selected.
I made an option group (frame0), with 6 options (Option1
thru Option6) that has option values 1 thru 6.
I created 6 combo boxes, names combo1 thru combo6. The
labels for the combo boxes I named Label_1 thru Label_6.
In the afterupdate event of frame0, I entered this code:

Private Sub Frame0_AfterUpdate()
Select Case Frame0
'option 1
Case 1
Me.Combo1.SetFocus
Me.Combo1.Dropdown
' option 2
Case 2
Me.Combo2.SetFocus
Me.Combo2.Dropdown
' option 3
Case 3
Me.Combo3.SetFocus
Me.Combo3.Dropdown
' option 4
Case 4
Me.Combo4.SetFocus
Me.Combo4.Dropdown
' option 5
Case 5
Me.Combo5.SetFocus
Me.Combo5.Dropdown
' option 6
Case 6
Me.Combo6.SetFocus
Me.Combo6.Dropdown
End Select
End Sub

If you want to draw the eye to the combo box, add this
code to each combo box, changing names to the proper combo
box:
 
Thanks for the colour formatting, How can I apply that to
change the view of individual records on a form ie red if
the due date is within a week of today's date or perhaps
black if the due date has passed and the job is not closed

If you are using A2K or higher, try Conditional formatting under the Format menu. Otherwise, if you are not using datasheet view, I think you could use the OnCurrent event and put some code to test for the condition to change the dolor/font..

'#### AIR code ##
if [due date] > Now the
me.[due date].BackColor = vbRe
end i

Re the combo boxes: I would like them to be linked to the
type of job: eg job number 50456 is jobtype 1. How do I

In the Rowsource for Combo1, open the query and in the Criteria row for the jobtype column enter 1. Only job numbers with a job type of one will be shown in the dropdown list
code the combo box 1 to drop down. The job number field
is a dropdown list from another table. So basically the
combo boxes do not need to show at all on the form. They
do at the moment because the selection has to be made with
each activity record entry. Thanks "heaps". mo

Not sure what you mean by this

If you want, copy the dB, put a little sample data in it, compact it, zip it and email it to me (I have A2K). I'll take a look..

Stev
 
Back
Top