dbTalk Databases Forums  

Control of allowedits when changing views

comp.databases.ms-access comp.databases.ms-access


Discuss Control of allowedits when changing views in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
saintor1@hotmail.com
 
Posts: n/a

Default Control of allowedits when changing views - 08-12-2010 , 02:19 PM






Access XP. My form has tabs, two of them have a subform (frmCarDet
that can be edited or not, and frmEventLog always editable).

When there is a date in closedon, "allowedits" is at false.
Everything works great as long as I stay in form mode.

I added the possiblity to browse quicker by using the datasheet
mode. I don't want people to add, modify, delete records in this
mode.

So here is the code;

Private Sub Form_Current()

Select Case Me.CurrentView
Case 1
Me.AllowAdditions = True
Me.AllowDeletions = True

If IsNull(Me.ClosedOn) = True Then
Me.AllowEdits = True
Me.Form!frmCarDet.Locked = False
Else
Me.AllowEdits = False
Me.Form!frmCarDet.Locked = True
End If

Me.Form!frmEventLog.Locked = False

Case 2
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False

End Select

End Sub

Problem is when I toggle from datasheet to form. The subforms
frmCarDet and frmEventLog can not be edited and I have no idea why.
Again as long as I never went to datasheet, I am fine and both are
editable when there is nothing in closedon. If I change to form from
datasheet, all the fields are editable but *both* subforms.

I tried to add

Private Sub Form_ViewChange(ByVal Reason As Long)
Form_Current
End Sub


Same result. I think that my subforms are just not recognized from
datasheet. Any idea / alternative way to achieve this?

Thanks in advance.

Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.