D
David Mueller
For simplicity, I've slimmed the scope of my problem down to three fields...
1. I have a form that is bound to a table with a couple fields - PersonID,
FirstName, LastName.
2. I don't have a control on the form that is bound to PersonID, but I can
reference the value of PersonID in VBA by using the following syntax ...
Me!PersonID
3. I passed this form to subroutine in a module.
4. In the module, I've lost the "Me" object, so the syntax from #2 above
doesn't work.
How do I reference the value of PersonID in the subroutine?
' how I would like to do it, but Me![...] syntax doesn't work
Public Sub ModifyControls(MyForm as Form)
For each control in MyForm.Controls
if me![PersonID] = xyz then control.visible = false
Next
End Sub
I hope I explained this ok.
Thanks in advance,
David
1. I have a form that is bound to a table with a couple fields - PersonID,
FirstName, LastName.
2. I don't have a control on the form that is bound to PersonID, but I can
reference the value of PersonID in VBA by using the following syntax ...
Me!PersonID
3. I passed this form to subroutine in a module.
4. In the module, I've lost the "Me" object, so the syntax from #2 above
doesn't work.
How do I reference the value of PersonID in the subroutine?
' how I would like to do it, but Me![...] syntax doesn't work
Public Sub ModifyControls(MyForm as Form)
For each control in MyForm.Controls
if me![PersonID] = xyz then control.visible = false
Next
End Sub
I hope I explained this ok.
Thanks in advance,
David