multiplying a global variable

genghis82

Registered User.
Local time
Today, 12:49
Joined
Aug 21, 2006
Messages
12
I have a global variable called g_dblConversion that saves the conversion rate from a seperate form for use in the order form.

On the order form I have a list price box which pulls the list price from the table on which I have placed the following on before update:
Code:
Me.TxtListPrice.Value = Me.TxtListPrice.Value * g_dblConversion
This works fine for the conversion, however we need to be able to overwrite this value from time to time as some of the contracts we recieved are already in the correct currency and value. When I try to overwrite this I get a runtime error 2115.

Can someone please suggest how I can allow it to overwrite??
Cheers
 
Hi Ken

If you are referring to the global variable as Single:

Option Compare Database
Global g_Conversion As Single
Option Explicit

Hope this is the info your looking for ??:confused:
 
If I may back-up...

I think I would put this in a table and call it with a dlookup()...
 
nevermind I was being a muppet again ! I put the after update event to another of the controls as having it on the same control I was wanting to bypass, was asking for trouble. I shall hang my head in shame ;)
 
Still... I would consider doing this differently. The way you have it is a step away from having it hard coded... :o
 
thanks for this suggestion Ken ;D made me rethink a lot of previous work i have done for similar suggestions which I have now replaced with the dlookup function. This is my first db so still learning!
cheers again
 

Users who are viewing this thread

Back
Top Bottom