Why not setup a table with the currency conversion you want? Then link the calculations to the currency selected in your drop down. That way you can add more currencies to the table without having to redo your code.
leeba <[EMAIL PROTECTED]> wrote:
leeba <[EMAIL PROTECTED]> wrote:
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 SubI 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
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Please zip all files prior to uploading to Files section.
SPONSORED LINKS
Microsoft access developer | Microsoft access help | Microsoft access database |
Microsoft access training | Microsoft access training course | Microsoft access programming |
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.