Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Setting the datasheet view to view only.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mya48 - 16 Mar 2005 23:47 GMT
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.
Douglas J. Steele - 17 Mar 2005 00:18 GMT
Set the form's AllowAdditions, AllowEdits and AllowDeletions properties to
False.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Can I set the Datasheet view of a form to read only? I want other users to
> be
[quoted text clipped - 3 lines]
>
> Thanks.
Mya48 - 17 Mar 2005 16:43 GMT
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.
[quoted text clipped - 6 lines]
> >
> > Thanks.
Douglas J. Steele - 18 Mar 2005 00:46 GMT
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.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(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
[quoted text clipped - 15 lines]
>> >
>> > Thanks.
Mya48 - 22 Mar 2005 18:17 GMT
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
[quoted text clipped - 19 lines]
> >> >
> >> > Thanks.
Douglas J. Steele - 23 Mar 2005 00:52 GMT
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]

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>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
[quoted text clipped - 32 lines]
>> >> >
>> >> > Thanks.
Mya48 - 29 Mar 2005 23:25 GMT
This is what I entered in the code window:

Private Sub Form_ViewChange(ByVal Reason As Long)

DoCmd.OpenForm "frmVitalSigns_Phones", [View As AcFormView =
acFormOpenDataMode], [FilterName], [WhereCondition], [DataMode As
AcFormOpenDataMode = acFormReadOnly], [WindowMode As AcWindowMode =
acWindowNormal], [OpenArgd]

End Sub

and it is still not working.

> Son of a gun. I never realized there wasn't a property that let you know
> what the current view was!
[quoted text clipped - 41 lines]
> >> >> >
> >> >> > Thanks.
Douglas J. Steele - 29 Mar 2005 23:59 GMT
You don't need (nor want) the square brackets in your call: what I pasted
was from the Help file, where the square brackets indicate that the
parameter is optional.

Assuming you actually have values defined for variables named FilterName,
WhereCondition and OpenArgd, try:

DoCmd.OpenForm "frmVitalSigns_Phones", acFormOpenDataMode, FilterName,
WhereCondition, acFormReadOnly, acWindowNormal, OpenArgd

Somehow, though, I suspect that you're not using a Filter and a Where
clause...

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> This is what I entered in the code window:
>
[quoted text clipped - 63 lines]
>> >> >> >
>> >> >> > Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.