Cancel as Integer (?)

C

croy

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

fredg

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.
 
G

Guest

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.
 
C

croy

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.
 
C

croy

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top