recordok

maxmangion

AWF VIP
Local time
Today, 19:01
Joined
Feb 26, 2003
Messages
2,805
i have seen the word RecordOk in some threads, what does this mean exactly ?

because i was thinking of using it with a before form update to set some validations, but i would like to make sure that i am aware of it's use.

i have tried clicking F1 in the vba editor, but i just got keyword not found.

any explanation is greatly appreciated

thank you!
 
maxmangion said:
does anyone have an idea about this pls ?

thanks
99% sure its not a built in thing, so its probly a boolean that people use during validation, its starts of false, and if it passes validation its true and gets saved.

and it just happens to be used by a lot of people.
 
therefore to be used in an if statement, does it have to be declared as a variable first ?

for example my intention in using such a thing is that before a record is updated in a form, i need to make sure that all fields are inputted, therefore i was planning to do something as follows in the before update of the form:

if recordok = true then
save record
else
cancel = true
and i do a msgbox with yes/no to check if user wants to continue editing the data or to undo the record.

or is there something else rather than using the recordok ?

thank you!
 
Yes it would have to be declared first a simple (dim RecordOk as boolean, though I'd use 'b' prefix).

Depending on your how you validate and save your record this variable might need to be accessible for multiple procedures on the form. So at the top of your form code after the 'Option Explicit' you'd have a 'Private RecordOk as boolean'.

note you wouldn't have a 'Public recordok...' anywhere as you might have multiple forms open, and then no way of telling which record is ok! :)
 

Users who are viewing this thread

Back
Top Bottom