I have a form for Registration for a conference. I
figured out the charges for everybody's participation. Since we have people from
all over the world I want to be able to change the currency depending on what
they want to pay with. I put on a drop down list or the different currencies
possible and depending on that I want it to fill in a text box. I put in the
following code to do this.
Private Sub ChangeCurrency_AfterUpdate() If [Currency].Text = "Dollar" Then If ChangeCurrency.Text = "Euro" Then NewAmmount.Text = Total.Text * 0.834224 ElseIf ChangeCurrency.Text = "Shekel" Then NewAmmount.Text = Total.Text * 4.59865 ElseIf ChangeCurrency.Text = "Sterling" Then NewAmmount.Text = Total.Text * 0.566647 ElseIf ChangeCurrency.Text = "Canadian Dollar" Then NewAmmount.Text = Total.Text * 1.1633 End If ElseIf [Currency].Text = "Euro" Then If ChangeCurrency.Text = "Dollar" Then NewAmmount.Text = Total.Text * 1.198719 ElseIf ChangeCurrency.Text = "Shekel" Then NewAmmount.Text = Total.Text * 5.512488 ElseIf ChangeCurrency.Text = "Sterling" Then NewAmmount.Text = Total.Text * 0.67925 ElseIf ChangeCurrency.Text = "Canadian Dollar" Then NewAmmount.Text = Total.Text * 1.39447 End If End If End Sub I know you can use case but I am better at Ifs. The problem is it tells me
that i can not read a field that does not have focus. How can i get around that.
THeir are two conferences. One is being charged in Euros and One in Dollars. Is
where the problem comes in. thanks.
Leeba
Please zip all files prior to uploading to Files section. YAHOO! GROUPS LINKS
|
- [AccessDevelopers] VBA question leeba
- Re: [AccessDevelopers] VBA question Mark Bacheldor
- Re: [AccessDevelopers] VBA question Trent Johnsey
- RE: [AccessDevelopers] VBA question Craig Gross