Password to prevent changes or additions

  • Thread starter Thread starter Gee...
  • Start date Start date
G

Gee...

I have a form for entering service calls.
The Customer name and address in the form draws from a query that draws from
a table of Customers.
We have a problem with people not paying attention and entering duplicate
customers.
I've been asked to prevent changes or additions while in the service call
form, execpt for a couple of people.
What we'd like is a password to make a change or enter an new customer so
when an employee is entering a service call, they can use existing customers,
just like always, but then if they change anything or if they enter a new
customer, they get a notice to enter a password.
Sounds easy but I can't figure it out...must be 'cause it's Friday!

Thanks in advance for your help.
G
 
well, you weren't clear about the form setup. i'm guessing it's a mainform
bound to the Customers table, with a subform bound to a service calls table.
if so, suggest you set the main form's AllowAdditions, AllowDeletions, and
AllowEdits properties to No. then add a command button to "Add/Edit Customer
Record". add code to the button's Click event, as

If InputBox("Enter the password, please.") = "some password" Then
With Me
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
Msgbox "Add/Edit options enabled."
Else
Msgbox "Password incorrect. Access denied."
End With
End If

note that, with the above code, once the properties are set to True, records
can be added/edited at will, until the form is closed.

An alternative would be to run similar code on the form's Load event, or
from a command button that opens the form, so the add/edit options are set
before the user even begins to use the form.

hth
 
Back
Top