allow..

tru-

Registered User.
Local time
Yesterday, 23:17
Joined
Jan 29, 2006
Messages
18
Else: DoCmd.OpenForm "frmAddEditProducts", acNormal
DoCmd.MoveSize 200, 2000, 15000 'if password is true then widen form
frmAddEditProducts.Form.AllowAdditions = True
frmAddEditProducts.Form.AllowDeletions = True
frmAddEditProducts.Form.AllowEdits = True

Debugger comes up regarding the last three lines, what am I doing wrong? Can I even do this?
I have a form open with additions/deletions/edits set to false, a button is clicked and a password form comes up (which the code above is in) if the correct pass is entered the above is run. I want the additions/deletions/edits set to true.

I've tried:
frmAddEditProducts.Form.AllowAdditions and frmAddEditProducts.AllowAdditions

Either its a simple error or I'm trying to do it the wrong way!
Thanks!
 
Change this;

Code:
frmAddEditProducts.Form.AllowAdditions = True

To this;

Code:
Me.Form.AllowAdditions = True
 
that doesnt work cos that would set them for frmPassword not frmAddEditProducts
 
Sorry, misread your question (missed the password form bit). This should work for you, I have not tried it so if you have any problems let me know and I will set it up in a sample db.

Replace this;
Code:
Else
DoCmd.OpenForm "frmAddEditProducts", acNormal
DoCmd.MoveSize 200, 2000, 15000 'if password is true then widen form
frmAddEditProducts.Form.AllowAdditions = True
frmAddEditProducts.Form.AllowDeletions = True
frmAddEditProducts.Form.AllowEdits = True
With This
Code:
Else
DoCmd.OpenForm "frmAddEditProducts", acNormal , , , , , "Allow" 'This is the OpenArg

In the on open event of your frmAddEditProducts. put this;
Code:
If Me.OpenArgs = "Allow" Then

    With Form
        .AllowAdditions = True
        .AllowDeletions = True
        .AllowEdits = True
    End With
Else
Exit Sub
End If
 

Users who are viewing this thread

Back
Top Bottom