General discussion

Locked

Access 97 : How to produce a Warning Box

By MoodySkipper ·
I am not a programmer and have little knowledge in access. But I have been posed with a problem. How or is there any way of bringing up a warning box before a user changes or deletes data in an access database?
If someone has the answer or thinks and they do and need more information please reply to my e-mail address.
This is so important to me I am using my last 178 points.

This conversation is currently closed to new comments.

11 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access 97 : How to produce a Warning Box

by parier In reply to Access 97 : How to produc ...

Create a macro (its as easy as a walkthrough) then apply the macro you save in the form or report to open at OPEN.

Collapse -

Access 97 : How to produce a Warning Box

by MoodySkipper In reply to Access 97 : How to produc ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 : How to produce a Warning Box

by Inspectorclave In reply to Access 97 : How to produc ...

There are many factors involved, but here is a glimpse. For the full code and options, email me at chrisp@metronational.com:

In an event you would put the following code:

Dim response as Integer

response = MsgBox("Do you want to save the changes?", vbExclamation + vbYesNo, "Save?"

if response = 6 then
docmd.gotorecord, , acnewrec
else
me.undo
end if

This is only one way and can have many alternatives. Email me for more info.

Collapse -

Access 97 : How to produce a Warning Box

by MoodySkipper In reply to Access 97 : How to produc ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 : How to produce a Warning Box

by Glenn from Iowa In reply to Access 97 : How to produc ...

The only real way you can keep unauthorized people from changing or deleting data is to secure the database. If you use programming based on forms, the user could still go into a table and change the data with no warning. And the best news is thatit requires no programming. The bad news is that if they do need to change the data, they either need to log in as another user, or use programming to change the permissions for the table. It is a somewhat detailed process, but Microsoft has posted a procedure for this on their Web site.

The basic process is to assign a password to the default Admin account, create a new user ID, then use the Security Wizard to secure the objects you want to secure. The wizard will then create a new database that is secure. You then need to assign users and rights to the appropriate objects in the new database. I did leave out some steps and details, but get the whole process, along with Frequently Asked Questions at http://support.microsoft.com/support/kb/articles/Q16

Collapse -

Access 97 : How to produce a Warning Box

by MoodySkipper In reply to Access 97 : How to produc ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 : How to produce a Warning Box

by Glenn from Iowa In reply to Access 97 : How to produc ...

Well, it apparenty cut off the previous URL. Find the procedure for securing a database at http://support.microsoft.com/support/kb/articles/Q165/0/09.asp

Collapse -

Access 97 : How to produce a Warning Box

by MoodySkipper In reply to Access 97 : How to produc ...

The question was auto-closed by TechRepublic

Collapse -

Access 97 : How to produce a Warning Box

by Glenn from Iowa In reply to Access 97 : How to produc ...

A less secure, but simpler way to warn users before changing data is to put the following code in the form?s Before Update property:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Const MsgStr = "***Warning*** You are about to make changes to data. " & _
"Click on Cancel, then press the [Esc] key to cancel changes."
If Me.NewRecord = False Then
If MsgBox(MsgStr, vbOKCancel) = vbCancel Then
Cancel = True
End If
End If
End Sub

Also look under the Dirty Property in Access help for another example of how to do this.

As far as deleting entire records, go to the Tools menu, Options, Edit/Find tab, and make sure the Record Changes check box under Confirm is checked.

This won?t keep users from changingdata in a table, but if they always use the form, it will warn them every time they make a change or deletion. To warn them when they make additions also, just remove the If Me.NewRecord = False statement.

Collapse -

Access 97 : How to produce a Warning Box

by MoodySkipper In reply to Access 97 : How to produc ...

The question was auto-closed by TechRepublic

Back to Software Forum
11 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums