How do I make my subform editable ...

Phonesa

Registered User.
Local time
Today, 11:57
Joined
Jul 3, 2003
Messages
27
I have a form with a subform on it. I have made it so the form can't be edited unless the user clicks my Edit button. So far, in my Edit button on click event:

me.allowedit = true

This allows me to edit my main form, but my subform remains uneditable. Help please!
 
Phonesa,

I normally achieve your task by the following:

Have the actual subform allowedits set to YES

Set the Main Forms subform object Locked property to YES

You can then use a command button on the main form to permit edits (unlock object) by:

Code:
Me.Subfrm_Object.Locked = False

Or, if you wish to toggle edit mode:

Code:
Private Sub CmdAllowEdit_Click()
If Me.Subfrm_Object.Locked = True Then
    Me.Subfrm_Object.Locked = False
    Me.CmdAllowEdit.Caption = "Lock Details"
Else
    Me.Subfrm_Object.Locked = True
    Me.CmdAllowEdit.Caption = "Unlock Details"
End If
End Sub

HTH

Brad
 
I've set the lock property for controls before, but I don't see the "Lock" property for the form. Am I looking in the wrong place?
 
Perhaps you linked the data of the subform to a query that's per definition not editable, like a query which has a GROUP BY statement.

Could you check that the query is editable, i.e. is there a last row visible with the * where you can put new data ?

(If your form is attached to a simple SELECT statement, it should be editable)

Regards,
Yves.
 
My main form DefendantInfo has a subform CitationDetails that users can edit when I have AllowEdits = True (on my main form). My subform is set to always be editable.

Here's what I then did: Set DefendantInfo.allowedits = false. Now I can only view the data on both my main and subform. I then created btnEdit whose click event just has me.allowedits = true. When I click on the button, I can edit my main form again, but my subform still remains uneditable. I had thought that if I made my main form editable, my subform would also become editable, but that is not the case. Still hoping that I can make this happen, otherwise I will just leave my subform uneditable and on the doubleclick event, pop up another form where they can edit the citation details.
 
Last edited:
Thanks all above. I have been trying everything to try and get my subform to allow/disallow edits and additions according to whether my main form also allows them (which in turn depends on the OpenArgs passed to the form). Locking/unlocking the subform works perfectly
 
Hello,

had the same issue. The subform was made by a query over various tables using the input of linked filds from the main form. Now I chaged the source object of the subform from QUERY to TABLE and now the subform can be edited.

Source Object (of the subform) = Table.<Table>

Saludos,
Michael
 

Users who are viewing this thread

Back
Top Bottom