Hi there!
I think I have quite a simple problem here. Basically, i'm trying to return the value of a specific field using the forms!<form name>!<field> object. I have a few forms that have the same fields and I wanted to create a module to validate what is in the field, but I can't seem to get the form name variable to work. The function is called using 'call CheckRecords(form.name)'
A scaled down version of the function looks like this:
public function CheckRecords(frmName)
msgbox forms!(frmName)!CmdID.value
End Function
I just can't seem to pass the form name through to the forms!... part without it generating an error or taking it literally. I've tried:
forms![frmName]!CmdID.value
forms!& frmName &!CmdID.value
..and variations thereof.
Please help!!!!!!!!!???????
I think I have quite a simple problem here. Basically, i'm trying to return the value of a specific field using the forms!<form name>!<field> object. I have a few forms that have the same fields and I wanted to create a module to validate what is in the field, but I can't seem to get the form name variable to work. The function is called using 'call CheckRecords(form.name)'
A scaled down version of the function looks like this:
public function CheckRecords(frmName)
msgbox forms!(frmName)!CmdID.value
End Function
I just can't seem to pass the form name through to the forms!... part without it generating an error or taking it literally. I've tried:
forms![frmName]!CmdID.value
forms!& frmName &!CmdID.value
..and variations thereof.
Please help!!!!!!!!!???????