Combo box to update field

G

Guest

I have a combo box (DesignJobSize) wich the row source type is set to Value
list and the row source is "XS";"S";"M";"L";"XL". What code can I add to the
After Udated event to update the HrsAllocated field. I want that field to
show "2" if the XS is selected from the combo box, "4" if S is selected, "8"
if M is selected, "12" if large is selected and "(Blank)" if XL is selected.
This is to show the amount of hours are needed for each project when a
designer is working on it. Is this possible? Your help is greatly
appreciated.
 
J

John W. Vinson

I have a combo box (DesignJobSize) wich the row source type is set to Value
list and the row source is "XS";"S";"M";"L";"XL". What code can I add to the
After Udated event to update the HrsAllocated field. I want that field to
show "2" if the XS is selected from the combo box, "4" if S is selected, "8"
if M is selected, "12" if large is selected and "(Blank)" if XL is selected.
This is to show the amount of hours are needed for each project when a
designer is working on it. Is this possible? Your help is greatly
appreciated.

I'd change the combo's properties so that the HrsAllocated is included. Set
the Column Count to 2 and intersperse the numeric values:

"XS";2;"S";4;"M";8;"L";12;"XL";Null

You can then either "push" the second column into a bound control in the
combo's AfterUpdate event, or - probably better - simply display it by putting
a textbox on the form with a control source

=DesignJobSize.Column(1)

to display the second column (it's zero based).

John W. Vinson [MVP]
 
C

Carl Rapson

Something like:

Select Case DesignJobSize
Case "XS"
HrsAllocated = "2"
Case "S"
HrsAllocated = "4"
Case "M"
HrsAllocated = "8"
Case "L"
HrsAllocated = "12"
Case "XL"
HrsAllocated = ""
End Select

Carl Rapson
 

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