J
Jan Kronsell
I have a form with a certain field, called "Rates". This is bound to a tabel
field by the same name. In my form I have a button with the following code:
Select Case Me!kialt.Value - Me!Rabat
Case Is <= 800
Me!Rates = 1
Case Is <= 1600
Me!Rates = 2
Case Is > 1600
Me!Rates = 3
End Select
This works pefectly ok and sets the "rates" field according to the rules.
The button does a lot of other stuff as well that also works OK.
But now my problem. I need to be able to set the rates field manually as
well. Thats is, overriding the setting made by the code. I can do that by
not clicking the butoon afterwards, of course, but how do I prevent users
from clicking the button after manually changing the rates field? Or is
there another way to make sure that changes done manually are not
overwritten by changes done by code?
To additional questions:
Is there anyway I can prevent a user doing anything, besides closing the
application, until he clicks on a certain button? What I want is to make
sure the users always clicks a certain button and nothing else, if they have
made changes to the data. I tried somethin like the Dirty event to disable
other buttons and the let relevant button enable them again, but I cannot
get it to work.
Finally the above code works perfectly, but if i change it to
Select Case Me!kialt.Value - Me!Rabat
Case Is <= 800
Me!Rates = 1
Case Is <= 1600
Me!Rates = 2
Case Else
Me!Rates = 3
End Select
It never gets to the Case Else no matter how big a number the calculation of
Me!kialt.Value - Me!Rabat gets.Any ideas why its so?
field by the same name. In my form I have a button with the following code:
Select Case Me!kialt.Value - Me!Rabat
Case Is <= 800
Me!Rates = 1
Case Is <= 1600
Me!Rates = 2
Case Is > 1600
Me!Rates = 3
End Select
This works pefectly ok and sets the "rates" field according to the rules.
The button does a lot of other stuff as well that also works OK.
But now my problem. I need to be able to set the rates field manually as
well. Thats is, overriding the setting made by the code. I can do that by
not clicking the butoon afterwards, of course, but how do I prevent users
from clicking the button after manually changing the rates field? Or is
there another way to make sure that changes done manually are not
overwritten by changes done by code?
To additional questions:
Is there anyway I can prevent a user doing anything, besides closing the
application, until he clicks on a certain button? What I want is to make
sure the users always clicks a certain button and nothing else, if they have
made changes to the data. I tried somethin like the Dirty event to disable
other buttons and the let relevant button enable them again, but I cannot
get it to work.
Finally the above code works perfectly, but if i change it to
Select Case Me!kialt.Value - Me!Rabat
Case Is <= 800
Me!Rates = 1
Case Is <= 1600
Me!Rates = 2
Case Else
Me!Rates = 3
End Select
It never gets to the Case Else no matter how big a number the calculation of
Me!kialt.Value - Me!Rabat gets.Any ideas why its so?