venkatramreddy_g
asked on
In access 2003 multiply 2 text box display result in 4th Text box based on 3rd Text box condition
Dear sir,
I am working in access 2003 and I have recently started I have created form, but I want 2 text boxes to be multiplied and result is displayed in 4th box based on the condition of 3rd box.
In the 3rd box I have fixed the list of 3 options based on selected option in the text box the result should be calculated in the 4th Text Box.
Please provide the solution.
Thanking you
Warm Regards,
I am working in access 2003 and I have recently started I have created form, but I want 2 text boxes to be multiplied and result is displayed in 4th box based on the condition of 3rd box.
In the 3rd box I have fixed the list of 3 options based on selected option in the text box the result should be calculated in the 4th Text Box.
Please provide the solution.
Thanking you
Warm Regards,
Sorry forgot the inverted comma around the cases
Private Sub ButtonName_Click()
Dim strCondition as string
strCondition=Me.TextBox3
Select Case strCondition
Case "condition1"
Your calculation
Case "Condition2"
your calculation
Case "Condition3"
Your calculation
End Select
End Sub
Private Sub ButtonName_Click()
Dim strCondition as string
strCondition=Me.TextBox3
Select Case strCondition
Case "condition1"
Your calculation
Case "Condition2"
your calculation
Case "Condition3"
Your calculation
End Select
End Sub
need a little bit more information.
you could set the default of the 4th control to a function or an expression which accepts parameters from the first three textboxes.
= (NZ(me.[Field1], 0) + NZ(me.[Field2], 0) + NZ(me.[Field3], 0)
But without knowing more about the values in first two textboxes, a better explaination of what is in the third, and how these relate to textbox 4, we cannot provide much help.
you could set the default of the 4th control to a function or an expression which accepts parameters from the first three textboxes.
= (NZ(me.[Field1], 0) + NZ(me.[Field2], 0) + NZ(me.[Field3], 0)
But without knowing more about the values in first two textboxes, a better explaination of what is in the third, and how these relate to textbox 4, we cannot provide much help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used iif solution for the above condition
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for venkatramreddy_g's comment http:/Q_27029623.html#36094743
for the following reason:
I used IIF Solution for my problem
Accepted answer: 0 points for venkatramreddy_g's comment http:/Q_27029623.html#36094743
for the following reason:
I used IIF Solution for my problem
ASKER
I slightly modified and used the IIF solution and result is stisfactory
ASKER
I couldnt assign the CASE STATEMENT code to form so I couldnt use this solution otherwise is very good solution
ASKER
g
> I used iif solution for the above condition
- as I suggested? Or how?
/gustav
- as I suggested? Or how?
/gustav
Private Sub ButtonName_OnClick()
Dim strCondition as string
strCondition=Me.TextBox3
Select Case strCondition
Case condition1
Your calculation
Case Condition 2
your calculation
Case Condition3
Your calculation
End Select
End Sub