Son of a gun. I never realized there wasn't a property that let you know
what the current view was!
When you open the form in DatasheetView, you have the option of opening
it
in ReadOnly by setting the datamode parameter to acFormReadOnly:
DoCmd.OpenForm formname[, view][, filtername][, wherecondition][,
datamode][, windowmode][, openargs]
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Mya48 said:
I have set the DefaultView to form view and I have added a button so
that
when I click on it, it opens the form in DatasheetView. This is still
not
doing what I need because I can edit, delete and add. Can you show me
an
example of what the code should look like? When you said add a button
they
can click on, what did you want the button to do?
Thanks.
:
Set the form's DefaultView to only allow form view, and add a button
that
they can click on. When they click on it, change the view to datasheet
and
set the form properties.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I see what you are saying but if I do this, I won't be able to edit,
add
or
delete in form view. I only want the users to be able to do all of
this
in
form view but not in datasheet view. Any other suggestions?
Thanks.
:
Set the form's AllowAdditions, AllowEdits and AllowDeletions
properties
to
False.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Can I set the Datasheet view of a form to read only? I want other
users
to
be
able to look at the datasheet view but not enter any data using
this
view.
Is
this possible? What would I need to enter in the code?
Thanks.