Cancel as Integer (?)

  • Thread starter Thread starter croy
  • Start date Start date
C

croy

I think I understand the "Cancel" part, but what does the
"as Integer" part do/refer to?
 
I think I understand the "Cancel" part, but what does the
"as Integer" part do/refer to?

It sets up the value of cancel to be an integer, i.e. -1 or 0.
Cancel = True evaluates as Cancel = -1.
Cancel = False evaluates as Cancel = 0.
 
Cancel is a variable name and Integer is the data type of the variable.
Variables declared as arguments in functions and subs are only visible to the
function in which they are used except when they are event subs and Access
provides arguments. In these cases, the arguments either provide a value or
act on a value. In this case, setting the value of Cancel to True (-1)
causes certain actions to occur depending on the type of event. For example,
setting Cancel to True in a Before Update event causes the event to cancel.
The update is not performed.
 
It sets up the value of cancel to be an integer, i.e. -1 or 0.
Cancel = True evaluates as Cancel = -1.
Cancel = False evaluates as Cancel = 0.


Ahah! Why did it take me so long to ask that question?!

Thank you.
 
Cancel is a variable name and Integer is the data type of the variable.
Variables declared as arguments in functions and subs are only visible to the
function in which they are used except when they are event subs and Access
provides arguments. In these cases, the arguments either provide a value or
act on a value. In this case, setting the value of Cancel to True (-1)
causes certain actions to occur depending on the type of event. For example,
setting Cancel to True in a Before Update event causes the event to cancel.
The update is not performed.


Thank you Klatuu!
 
Back
Top