J
Jonathan
Hi, using Access version 2003. Most of my forms have manditory fields. So I
have a form variable (collection) that stores the names of the manditory
fields. When the form opens I load this collection. In the form_beforeUpdate
event I then call a public function located in a standard module. This
function then cycles through the form's collection to perform data validation
check.
Dim intLoop As Integer
Dim ctlName As String
For intLoop = 1 To myForm.mandatoryCtrlCount
ctlName = myForm.mandatoryCtrl(intLoop)
The first line calls a form property that returns a correct count of items
in the collection of field names. The next line returns a system error:
'Error 450 (Wrong number of arguments or invalid property assignment) in
procedure...'
The first line of the form property is:
Public Property Get manditoryCtrl(myItem As Integer) As String
If I call this same property from the form itself then the correct item is
returned. It is only when calling this property from the standard module that
an error is raised. Why?
I'm sure it's something blindingly obvious....
Any ideas or recommendations appreciated
Many thanks,
Jonathan
have a form variable (collection) that stores the names of the manditory
fields. When the form opens I load this collection. In the form_beforeUpdate
event I then call a public function located in a standard module. This
function then cycles through the form's collection to perform data validation
check.
Dim intLoop As Integer
Dim ctlName As String
For intLoop = 1 To myForm.mandatoryCtrlCount
ctlName = myForm.mandatoryCtrl(intLoop)
The first line calls a form property that returns a correct count of items
in the collection of field names. The next line returns a system error:
'Error 450 (Wrong number of arguments or invalid property assignment) in
procedure...'
The first line of the form property is:
Public Property Get manditoryCtrl(myItem As Integer) As String
If I call this same property from the form itself then the correct item is
returned. It is only when calling this property from the standard module that
an error is raised. Why?
I'm sure it's something blindingly obvious....
Any ideas or recommendations appreciated
Many thanks,
Jonathan