"read-everything" calendar!

Martyh

Registered User.
Local time
Yesterday, 19:08
Joined
May 2, 2000
Messages
196
Hi,

I have a form that is designated read only. I've put a calendar on the double-click of a control in that form.

When the form is in regular edit mode the calendar works fine, but when the form is in read-only mode then the calendar continues to function (ie you can double click and change the date -- and not only that, once the date has been changed in the field, all the rest of the form becomes editable!

What advice have you got that would stop this "read everything" calendar!

Thanks,
 
are you sure everything is becoming editable?

even though you specify no edits, you can still change values with code. so possibly some code in the datepicker is then changing values on the form. The fields themselves will remain non-editable to the user interface
 
The fields themselves will remain non-editable to the user interface

No, gemma, the OP is correct. Whether the form is opened from another form, using the acFormReadOnly argument, or AllowEdits is set to No in the form's property, once any field in the current record is changed thru code, all fields can be edited, until the user moves to another record. Then the read-only status resumes.

How are you putting the form in "read-only mode" and "regular edit mode?"

If you're calling the form from another form, using

DoCmd.OpenForm stDocName, , , , acFormReadOnly

to call it in Read-Only mode and

DoCmd.OpenForm stDocName, , , , acFormEdit

to call it in Edit mode, you can add an OpenArgs argument to the command to call it in read-only

Code:
DoCmd.OpenForm stDocName, , , , acFormReadOnly, , "Turn Off Calendar"

and then, in the Form_Load of the called form, use

Code:
Private Sub Form_Load()
 If Me.OpenArgs = "Turn Off Calendar" Then
  MyCalendarName.Enabled = False
 End If
End Sub
IF the OpenArgs is there, the calendar will be "turmed off," otherwise it will work!
 
Last edited:
thanks linq

didnt realise that - makes sense i suppose, but not obvious at all - i doubt if ive ever tried to edit fields in such a case
 
That's because you're a programmer/developer and think as such. Users are a whole other ball game! The problem with making things 'idiot-proof" is that idiots are so darn ingenious!
 
That's because you're a programmer/developer and think as such. Users are a whole other ball game! The problem with making things 'idiot-proof" is that idiots are so darn ingenious!
And haven't you noticed that they are getting more ingenious every year:D
 

Users who are viewing this thread

Back
Top Bottom