Lock and Unlock a form

M

myseven123

I am currently working on a database that would act like a ledger tracking
minimal data on existing purchase orders. I am fairly new at this so please
let me know if you need more info.

I have created a form that I want to give different access to various users.
One user will be allowed to add records, one user will be able to update data
(records) on the previous users data, and the rest will have view only status
(which I believe I can control through the network).

My question: How can I lock the existing records after the first user has
added records and then unlock those records when updates are required?
Basically I have four fields that need to be available for updates every time
the second user accesses the form (preferably without the ability to delete
or update the first user’s records).

Brief overview of the Data (fields):
To be locked:
Ref ID (autonumber)
Ref# (text)
Date issued (date/time)
Description (text)
Vendor ID (combo box/subform)
Requester Name (combo box/subform)

To be unlocked at a later time:
Received (Check box - yes,no)
Date received (date/time)
PO amount (currency)
Notes (memo)

Also, there are 2 subforms (vendor ID and requester name) available as a
label on the main form for updating vendor info and names. Not sure how
relevant to my issue but I do need the data from these subforms locked after
the first user adds a new Ref.

Thanks,
Laura
 
T

Tony Toews [MVP]

myseven123 said:
My question: How can I lock the existing records after the first user has
added records and then unlock those records when updates are required?

Locking fields on a form in Microsoft Access
http://www.granite.ab.ca/access/locking_fields_on_a_form.htm

Also consider an audit trail.

There's a simple example at
ACC2000: How to Create an Audit Trail of Record Changes in a Form
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197592

Audit Trail - Log changes at the record level at:
http://allenbrowne.com/AppAudit.html
The article addresses edits, inserts, and deletes for a form and
subform.

Modules: Maintain a history of changes
http://www.mvps.org/access/modules/mdl0021.htm
The History Table routine is designed to write history records that
track the changes made to fields in one or more tables.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

myseven123

Although this was great information...I do not thouroughly understand what I
need to do and exactly how to transpose this info into my database. I either
need more detailed information regarding my particular problem or you could
say, "I am just over my head!"

Thanks again,
Laura
 
T

Tony Toews [MVP]

myseven123 said:
Although this was great information...I do not thouroughly understand what I
need to do and exactly how to transpose this info into my database. I either
need more detailed information regarding my particular problem or you could
say, "I am just over my head!"

You do need some knowledge of VBA code to implement these solutions.
It can be done but, quite honestly, I'm not the right person to help
you figure that out. I say that simply because I don't know how I'd
start to show someone how to use it. (I've been doing this too long
and have been programming for umm, 34 or years now. Since I was a
teen on punched cards.)

Access <insert your version> Programming for Dummies would likely be a
good start.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
M

myseven123

I know Visual Basic.net...which I thought was almost the same as VBA. Am I
mistaken in thinking that VBA works in a similar fashion?
 
T

Tony Toews [MVP]

myseven123 said:
I know Visual Basic.net...which I thought was almost the same as VBA. Am I
mistaken in thinking that VBA works in a similar fashion?

They are somewhat similar. Indeed just similar enough that some
things could cause great confusion. For example it's my understanding
that a VB.Net int is 32 bits but in Access VBA/VB 6.0 it's 16 bits.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top