G
Guest
I need urgent help to solve a VBA problem. What is the syntax of the Select
case statement for the following:
I have to fields in a subform...One is a combo box which has values A,ItemA;
B,ItemB etc
The other is a Cost field which is a combo box with number values
corresponding to each item....£100 and £120 for A, £200 and £240 for B etc.
What I want the Selec Case statement to do is to connect these two fields
according to criteria on the Mainform :
The mainform has 2 fields: Plan_Type (values are S1,S2,3 etc) and Issue_No
(values 1,2,3 etc)
The case statement I have got is:
Plan_Type Issue No Or Plan_Type Issue No
case S1 & 1 , Case S1 & 2
StrList = "A;'Item A';B;'Ite B'" etc
Plan_Type Issue No Or Plan_Type Issue No
case S2 & 1 , Case S2 & 2
StrList = "c;'Item C';D;'Item D'" etc
The strList is then displayed in the combobox according to the criteria
What I need is a code which is something like this:
When Plan_Type = S1 and ssue_No = 1, then StrList = "A;'Item A';B;'Ite B'"
etc and Cost field = 100 when Item is A, Cost Field = 200 when Item is B
When Plan_Type = S1 and ssue_No = 2, then StrList = "A;'Item A';B;'Ite B'"
etc and Cost field = 130 when Item is A, Cost Field = 240 when Item is B
How can I do this in a Case Statement please?
Please Help
rob
case statement for the following:
I have to fields in a subform...One is a combo box which has values A,ItemA;
B,ItemB etc
The other is a Cost field which is a combo box with number values
corresponding to each item....£100 and £120 for A, £200 and £240 for B etc.
What I want the Selec Case statement to do is to connect these two fields
according to criteria on the Mainform :
The mainform has 2 fields: Plan_Type (values are S1,S2,3 etc) and Issue_No
(values 1,2,3 etc)
The case statement I have got is:
Plan_Type Issue No Or Plan_Type Issue No
case S1 & 1 , Case S1 & 2
StrList = "A;'Item A';B;'Ite B'" etc
Plan_Type Issue No Or Plan_Type Issue No
case S2 & 1 , Case S2 & 2
StrList = "c;'Item C';D;'Item D'" etc
The strList is then displayed in the combobox according to the criteria
What I need is a code which is something like this:
When Plan_Type = S1 and ssue_No = 1, then StrList = "A;'Item A';B;'Ite B'"
etc and Cost field = 100 when Item is A, Cost Field = 200 when Item is B
When Plan_Type = S1 and ssue_No = 2, then StrList = "A;'Item A';B;'Ite B'"
etc and Cost field = 130 when Item is A, Cost Field = 240 when Item is B
How can I do this in a Case Statement please?
Please Help
rob