Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

Modify Edd/Add Record/Deletion Properties of Form and Child Subfor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Access User - 11 Mar 2008 20:14 GMT
Hi,

I have a form and a correlated sub-form. I want to prevent the data enterer
from modifying the form unintentionally when he clicks a check box
"Completed". I tried some simple VBA in the "Completed" control's "On Click"
property but it had the effect of also freezing the user out of un-checking
the same control if the need were to arise later on.

What's the right way to approach that? Anyone?

TIA.
Stockwell43 - 11 Mar 2008 20:59 GMT
If it's a thing of being able to uncheck the box when needed, you can place a
button on the form to have it unfreeze the checkbox when clicked. OR if it is
a controlled thing, use a password field and a button so when the password is
entered, click the button and it release the freeze. If it is for editing
purposes only you may want to make it so it only activate on current record
so once you leave the record, it will freeze the checkbox up again. Just a
few ideas to ponder on.

> Hi,
>
[quoted text clipped - 7 lines]
>
> TIA.
Access User - 17 Mar 2008 20:48 GMT
Hi,

At this point, passwords are probably more than's needed, but on the other
point in your mention, I would think that there would be a way to exclude a
control from an overall freezing of controls on a form but if there is it
escapes me how. Are you saying that somehow, if controls like checkboxes are
not exemptable from some sort of form-wide freezing of controls that buttons
ARE?

Currently, I'm punting and have just worked with modifying the color of the
control's label, so I'm using the following VBA

Private Sub Complete_AfterUpdate()

  If Me.Complete = -1 Then
     Me![Label59].BackColor = vbGreen
     Me![Label59].ForeColor = vbBlack
  End If
  If Me.Complete = 0 Then
     Me![Label59].BackColor = vbRed
     Me![Label59].ForeColor = vbYellow
  End If
 
End Sub

and also

Private Sub Form_Current()

  If Me.Complete = -1 Then
     Me![Label59].BackColor = vbGreen
     Me![Label59].ForeColor = vbBlack
  End If
  If Me.Complete = 0 Then
     Me![Label59].BackColor = vbRed
     Me![Label59].ForeColor = vbYellow
  End If

End Sub

> If it's a thing of being able to uncheck the box when needed, you can place a
> button on the form to have it unfreeze the checkbox when clicked. OR if it is
[quoted text clipped - 15 lines]
> >
> > TIA.
Cheese_whiz - 11 Mar 2008 21:13 GMT
AU,

If your issue is not resolved, try posting the code you used.

CW

> Hi,
>
[quoted text clipped - 7 lines]
>
> TIA.
Access User - 12 Mar 2008 15:51 GMT
The name of the form was "MRA Form" and here's the VBA; assumes -1 = "Yes"
and 0 = "No" on a check-box. When user clicks on check-box ("Complete" is its
name), I want it disable edits/additions/deleteions to that form's data but
to continue to allow user the ability to un-check "Complete" checkbox down
the road if user seiously needs to update or modify the record behind the
form. I hadn't mentioned this but there's a correlated sub-form (name I don't
recall at this moment) on this form and I think it'd be good if the
"Complete" check-box prevented further modifications to the data the
sub-form/table.

Private Sub Complete_Click()

 If Me.Complete = -1 Then
     Me.Form.AllowEdits = False
     Me.Form.AllowAdditions = False
     Me.Form.AllowDeletions = False
     Me.Complete.Enabled = True
     
 End If
 
 If Me.CommandBeforeExecute = 0 Then
     Me.Form.AllowEdits = True
     Me.Form.AllowAdditions = True
     Me.Form.AllowDeletions = True
     Me.Complete.Enabled = True
     
 End If
 
End Sub

> AU,
>
[quoted text clipped - 13 lines]
> >
> > TIA.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.