A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Restricting edits in form with subforms



 
 
Thread Tools Display Modes
  #1  
Old May 30th, 2004, 05:43 AM
Sandra
external usenet poster
 
Posts: n/a
Default Restricting edits in form with subforms

I have a tabbed form based on master table DONORS. The
first page is for entering the master record in DONORS.
I have a subform on the next tab page that links to a
table RELATIONS. When the main form is opened AllowEdits
and AllowDeletions set to NO to prevent "misedits" when
using Find. I have an EDIT command button on the form
which sets AllowEdits and AllowDeletions to YES.

The Event Procedure for the EDIT button is as follows:
Private Sub EditRecord_Click()
On Error GoTo Err_EditRecord_Click
Me.Detail.BackColor = 255
Me.AllowEdits = True

Exit_EditRecord_Click:
Exit Sub

Err_EditRecord_Click:
MsgBox Err.Description
Resume Exit_EditRecord_Click

End Sub

Then, in the AfterUpdate:
Private Sub Form_AfterUpdate()
Me.AllowEdits = False
Me.AllowDeletions = False
Me.Detail.BackColor = 12615680
End Sub

This works fine for the DONORS main form, but doesn't
make the switch from NO to YES in the linked subform for
RELATIONS on the other tabbed page, even though the
normal open mode for this subform is YES.

What am I doing wrong?

Thanks,
Sandra
  #2  
Old May 30th, 2004, 09:32 AM
Steve Schapel
external usenet poster
 
Posts: n/a
Default Restricting edits in form with subforms

Sandra,

I think you will need to manage these properties of the subform
separately, for example...
Me.Relations.Form.AllowEdits = True

--
Steve Schapel, Microsoft Access MVP


Sandra wrote:
I have a tabbed form based on master table DONORS. The
first page is for entering the master record in DONORS.
I have a subform on the next tab page that links to a
table RELATIONS. When the main form is opened AllowEdits
and AllowDeletions set to NO to prevent "misedits" when
using Find. I have an EDIT command button on the form
which sets AllowEdits and AllowDeletions to YES.

The Event Procedure for the EDIT button is as follows:
Private Sub EditRecord_Click()
On Error GoTo Err_EditRecord_Click
Me.Detail.BackColor = 255
Me.AllowEdits = True

Exit_EditRecord_Click:
Exit Sub

Err_EditRecord_Click:
MsgBox Err.Description
Resume Exit_EditRecord_Click

End Sub

Then, in the AfterUpdate:
Private Sub Form_AfterUpdate()
Me.AllowEdits = False
Me.AllowDeletions = False
Me.Detail.BackColor = 12615680
End Sub

This works fine for the DONORS main form, but doesn't
make the switch from NO to YES in the linked subform for
RELATIONS on the other tabbed page, even though the
normal open mode for this subform is YES.

What am I doing wrong?

Thanks,
Sandra

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.