access vba - Trying to resolve an "invalid use of Null" in VBA -


quick snippet first:

dim guid string dim givennames, familyname, preferredname, gender, comments, carer, medicarenumber, patientnumber string dim dob variant dim deceased, resolved, consultnotes boolean dim age variant  givennames = null familyname = null preferredname = null gender = null dob = null comments = null deceased = false resolved = false carer = null age = null consultnotes = false patientnumber = null ' error 

any idea why last variable 1 trip up? i've assigned null bunch of other strings without errors.

in vba/vb6, strings cannot set null; variants can set null. in addition, when declare variables inline comma-separated in question, last 1 typed string; of others typed variants. declare them on 1 line type have include type

dim string, dim b string ... 

that's why makes sense declare them on single line.

(btw, should noted deceased, resolved typed variants same reason.)


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -