passing form as form to the module

mstres

Registered User.
Local time
Today, 10:07
Joined
Mar 18, 2009
Messages
24
How to pass form as form to module with out open a form.
I have a lot of users with difference privileges RW, RO, NO Access at all
I would like to use one module and passing form as object or form and manipulate with user security.
I can pass form as form when form is open.
My code: call from Form1

Private Sub Command1_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "form2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Call pOpenForm(Forms!form2)
End Sub

Call to Module:
Private Function pOpenForm(ByVal ofrmName As Form)

ofrmName.AllowEdits = True
ofrmName.AllowAdditions = True
End Function

This code is working, but I would like to move
DoCmd.OpenForm stDocName, , , stLinkCriteria
to module.
Thank you in advance
Mike
 
Last edited:
Untested, but try

DoCmd.OpenForm ofrmName.Name
 
Untested, but try

DoCmd.OpenForm ofrmName.Name
Thank you for trying to help but I have complitly difference isue.
I need to pass form from one form to module, monipulate with user security and after that open form with RW or RO or not open at all
Thank you again
Mike
 

Users who are viewing this thread

Back
Top Bottom