Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to "remove" or "secure" records after report prints

Status
Not open for further replies.

goslincm

MIS
May 23, 2006
292
US
I'm not sure how to do this or where. After users print a monthly report, I need the data in that report to be placed into a state where the user can no longer makes changes to it, yet it would be available should the supervisor need to make changes.

There will be several different users each printing a different monthly report.

 
Ahhh....what I think you need to do is check to see if you are at the new record. If you are at the new record indicator, you don't want to process the code...so something like this instead of what you currently have in the OnCurrent event:

Code:
If Me.NewRecord Then
Me.[voucher_id].Locked = False
Me.[voucher_number].Locked = False
Me.[voucher_fiscal_year].Locked = False
Me.[voucher_end_date].Locked = False
Me.[voucher_begin_date].Locked = False
Else
Me.[voucher_id].Locked = Not Me.[IsEditable].Value
Me.[voucher_number].Locked = Not Me.[IsEditable].Value
Me.[voucher_fiscal_year].Locked = Not Me.[IsEditable].Value
Me.[voucher_end_date].Locked = Not Me.[IsEditable].Value
Me.[voucher_begin_date].Locked = Not Me.[IsEditable].Value
End If

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
That makes the difference, works much better. Is there a place I can put some code so things update while I'm still on that form, instead of having to close it, then return to it for everything to be locked?
 
Sure.....but you have to figure the logic out. You could add a command button that says "Update" or something, and when clicked it runs the locking code of:

Code:
Me.[voucher_id].Locked = Not Me.[IsEditable].Value
Me.[voucher_number].Locked = Not Me.[IsEditable].Value
Me.[voucher_fiscal_year].Locked = Not Me.[IsEditable].Value
Me.[voucher_end_date].Locked = Not Me.[IsEditable].Value
Me.[voucher_begin_date].Locked = Not Me.[IsEditable].Value

Or if that is not good for you, you need to figure out what would be. You could use the leaving of a particular field or something, but the logic will be yours to decide...If you need some suggestions, you can provide us a description of the layout of your form and the "expected" use (because we know that users ALWAYS foloow your thoughts [smile]), we might be able to help you decide what to use.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top