Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down box controlling a text box

Status
Not open for further replies.

CMooreJr

Technical User
Feb 20, 2003
217
0
0
US
I have a drop down box that lists the status of projects. The list is pulled from a lookup table. The name of the box is "project_status".

They want the "project_status" to control the complexity of the project. For instance, if a status is "New", it may be complexity "1". However if a status is "Creative Development" it may be a complexity of "8". I have a text box named "project_complexity". How can I have the drop down autopopulate the complexity field depending on what is chosen?

(The complexity levels are 1-8) and the status are (New, Project Development, Creative Development, Prototyping, Production, Shipping, and Complete) They are coming up with the complexity number for each status now.

Thanks!
 
Try and after_update event.

after_update
If project_status = "New" Then
project_complexity = "1"
End If

You could use a Case Select statement.
There are a lot of ways of doing it.

Perhaps the easiest way, would be to have a small table that maps the project complexity to the project status.

Then turn the textbox into a combobox who's source querys that table and sets the project status based on the projet_status combobox, and is requeried after the project_status combobox is updated.



David Pimental
(US, Oh)
dpimental@checkfree.com
 
(The complexity levels are 1-8) and the status are (New, Project Development, Creative Development, Prototyping, Production, Shipping, and Complete) They are coming up with the complexity number for each status now.

tblProjectStatus
ID - Description
1 New,
2 Project Development,
3 Creative Development,
4 Prototyping,
5 Production,
6 Shipping,
7 Complete
8 ??

Put that into a combo, hide the first column so only the complexity shows. The main table holds the ID ONLY, then you can link your tables together on queries/reports.


Vince
 
Several ways to do this. I personally would run a case statement.

Dim intStatusValue As Integer

intStatusValue = CInt(Me.ComboBox.Column(0)
Select intStatusValue

Case 1
Complex level 1;
Case 2
Complex level 2;
Case 3
Complex Level 3;

and so on
This assumes the column 0 is a number column starting at one in your project staus table

Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top