Hi All
I am trying to reference a glabal form variable from a function, but for some reason it doesn't seem to work.
On the form, I have a call to run a validation function as follows:
If var_ChangeHasOccurred = True Then Call CheckChanges(Form.Name)
The form name should be sent to the function (which it is). In the function, I need to set the variable 'var_ChangeHasOccurred' to false. A scaled down version of my function looks something like this:
Public Function CheckChanges(FrmName)
Forms(FrmName).var_ChangeHasOccurred = False
'<do something else here>
End Function
The only problem is when I try to set the variable to false in the function, it displays an error saying Access cannot find a field called 'var_ChangeHasOccurred'. I've tried the '.' and '!' symbols but neither work.
The same also happens when I try to set the form dirty to false in the fucntion: Forms(FrmName).dirty = false
Any ideas? Thanks!
I am trying to reference a glabal form variable from a function, but for some reason it doesn't seem to work.
On the form, I have a call to run a validation function as follows:
If var_ChangeHasOccurred = True Then Call CheckChanges(Form.Name)
The form name should be sent to the function (which it is). In the function, I need to set the variable 'var_ChangeHasOccurred' to false. A scaled down version of my function looks something like this:
Public Function CheckChanges(FrmName)
Forms(FrmName).var_ChangeHasOccurred = False
'<do something else here>
End Function
The only problem is when I try to set the variable to false in the function, it displays an error saying Access cannot find a field called 'var_ChangeHasOccurred'. I've tried the '.' and '!' symbols but neither work.
The same also happens when I try to set the form dirty to false in the fucntion: Forms(FrmName).dirty = false
Any ideas? Thanks!