Try using CurrencyText.Value instead of CurrencyText.Text

 

Craig Gross

Sr. Pub Reporting and Profitability Analyst

Baker & Taylor

1120 U.S. Highway 22 East

Bridgewater NJ 08807

908-541-7197 Tel

908-541-7862 Fax

[EMAIL PROTECTED]


From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of leeba
Sent: Tuesday, December 20, 2005 5:50 AM
To: AccessDevelopers@yahoogroups.com
Cc: MS_Access_Professionals@yahoogroups.com
Subject: [AccessDevelopers] VBA question

 

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



This email and any attachments contain information from Baker & Taylor which may
be confidential, privileged and/or protected by other legal rules. If you are not the
intended recipient, you are hereby advised that any disclosure, copying, distribution or
use of the contents of this email is prohibited. If you have received the email in error,
please notify us by reply email immediately and then delete the email and your reply
from your email system. NOTE: Baker & Taylor accepts no liability for the contents of
this email. This email shall not operate to bind Baker & Taylor to any contract, order
or other obligation.




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




Reply via email to