Allow Edit Issue

S

scott04

Hey everyone,

I am having a problem getting my subform to allow edits since its property
under normal conditions does not allow edits. I understand from looking at
posts that the format should be :
Me.NameOfSubformControl.Form.AllowEdits = True

When I click on my subform under properties it lists source object
frmAuditlifesubform so i am guessing that is the name of my subform
control????? The code i am using is the following:
If InputBox("Enter the password to edit the subform records?", "T6B22") =
"T6B22" Then
Me.frmAuditLifesubform.Form.AllowEdits = True
Else
MsgBox "Edit Canceled"
Cancel = True
Err_DeleteRecord_Click:
MsgBox Err.Description
End If
The inputbox does come up and prompts me for password. I enter in the
correct password but it still does not let me edit the subform. Any ideas on
how i can make this work or better? Thanks.
 
M

Marshall Barton

scott04 said:
I am having a problem getting my subform to allow edits since its property
under normal conditions does not allow edits. I understand from looking at
posts that the format should be :
Me.NameOfSubformControl.Form.AllowEdits = True

When I click on my subform under properties it lists source object
frmAuditlifesubform so i am guessing that is the name of my subform
control????? The code i am using is the following:
If InputBox("Enter the password to edit the subform records?", "T6B22") =
"T6B22" Then
Me.frmAuditLifesubform.Form.AllowEdits = True
Else
MsgBox "Edit Canceled"
Cancel = True
Err_DeleteRecord_Click:
MsgBox Err.Description
End If
The inputbox does come up and prompts me for password. I enter in the
correct password but it still does not let me edit the subform. Any ideas on
how i can make this work or better? Thanks.


First, then name of the subform control is in its Name
property, not its SourceObject property. The SourceObject
property specifies the name of the form object that will be
displayed in the subform control and can be changed in code
without affecting references to the items in the form
object. It is a common practice to have the Name and
SourceObject the same, but it is not required. You probably
do have them the same or I would expect an error.

I suspect that the problem is because the subform is based
on a query that is not updatable. Try opening the subform's
record source query directly from the database window or
query designer and check if you can edit a record in the
query's datasheet view.
 

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

Similar Threads


Top