locking a form after 24 hours

  • Thread starter Thread starter jomara via AccessMonster.com
  • Start date Start date
J

jomara via AccessMonster.com

I have a form for salespeople to enter sales right now i have it set for no
edits. Seems people dont know how to enter data because 1 out of 3 are wrong
i would like to make the form editable till the next day or untill the
accounting dept runs their sales query. Whichever is easier is the way i
will go
 
First, data entry issues can be resolved with training. However, you may not
have the time. So you have to established data entry rules. Perhaps, you
should include within the design of the form a " * “symbol next to required
fields and then place a label that reads†* REQUIRED FIELD " in red bold text.
That will grab some attention! Also include data validation rules. Within
the form you can create input masks to format the way data can be entered.
You may also set data defaults on certain fields. The use of Combo Boxes
that limit data entry to the items on the list is great for eliminating typos.
Nevertheless, I think your data entry issues can be resolved with more work
on your part.

Second, you set the form's property "Allow Edits" to equal "No" must mean you
are manually adjusting this form's property on a daily basis. What a pain!
To automate the form to Allow Edits from "No" to "Yes" you must use VBA.
Since your Accounting Department must be running during a certain time of day
(let's say between 11am and 1pm), you don't want anyone to modify records
during that time. Here is what I came up with.

Step 1. Open the form in design view and set the form's property "Timer
Interval = 1000"
Step 2. Place the cursor in the property "On Timer" and create an Event
Procedure. Copy and Paste the code below between the words “Copy From Here
To Hereâ€.


Private Sub Form_Timer()

'Copy From Here

If Format(Time(), "hh:mm:ss AMPM") >= #11:00:00 AM# And Format(Time(),
"hh:mm:ss AMPM") <= #1:00:00 PM# Then
Me.AllowEdits = False
Else
Me.AllowEdits = True
End If

'To Here

End Sub


The event procedure will check the time every second to see if it is between
11am and 1pm. This should get you started. Much luck and success to you!
 

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

Back
Top