code to allow edits in form AND subform

G

Guest

Ok, here goes.............
I have a form (frmBOL) which contains a subform (sfrmData). I have this
code working to allow the form to be edited, but I can't seem to incorporate
the subform into it. Everything I try gives me an error. Can anyone help?

Private Sub cmdOK_Click()
Dim sPassword As String

sPassword = Nz(Me.txtPassword.Value, "")


' if it is a valid password, we let them edit the
' form that called this form. The calling form is
' responsible for check that the current user is
' either the QA tech on the record, or a member
' of the admins or full permissions group, this form
' only checks to see if the password they are entering
' top unlock that form is valid
If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName],
sPassword) Then
Forms!frmBol.AllowEdits = True

DoCmd.Close acForm, Me.Name
Else
MsgBox "Unable to validate password, please verify it is typed
correctly!", vbExclamation
End If
End Sub
 
S

Steve

Under Forms!frmBol.AllowEdits = True add:
Forms!frmBol!NameOfSubformControlOnfrmBOL.Form.AllowEdits = True

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Thank you sooo much!
--
Miranda


Steve said:
Under Forms!frmBol.AllowEdits = True add:
Forms!frmBol!NameOfSubformControlOnfrmBOL.Form.AllowEdits = True

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)




Miranda said:
Ok, here goes.............
I have a form (frmBOL) which contains a subform (sfrmData). I have this
code working to allow the form to be edited, but I can't seem to
incorporate
the subform into it. Everything I try gives me an error. Can anyone
help?

Private Sub cmdOK_Click()
Dim sPassword As String

sPassword = Nz(Me.txtPassword.Value, "")


' if it is a valid password, we let them edit the
' form that called this form. The calling form is
' responsible for check that the current user is
' either the QA tech on the record, or a member
' of the admins or full permissions group, this form
' only checks to see if the password they are entering
' top unlock that form is valid
If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName],
sPassword) Then
Forms!frmBol.AllowEdits = True

DoCmd.Close acForm, Me.Name
Else
MsgBox "Unable to validate password, please verify it is typed
correctly!", vbExclamation
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top