A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

disable datasheet view in form



 
 
Thread Tools Display Modes
  #1  
Old June 9th, 2004, 06:08 PM
John Milbury-Steen
external usenet poster
 
Posts: n/a
Default disable datasheet view in form

Hi Access gurus:

I am using Access 2002.
I have a popup form which I want to open only in datasheet view. In the
properties list of the form, I have the following settings:

Default View: datasheet
Allow Form View: No
Allow Datasheet View: Yes

However, the form still opens in Form View! What do I have to do to enforce
Datasheet View?


  #2  
Old June 9th, 2004, 06:16 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default disable datasheet view in form

"John Milbury-Steen" wrote in message

Hi Access gurus:

I am using Access 2002.
I have a popup form which I want to open only in datasheet view. In
the properties list of the form, I have the following settings:

Default View: datasheet
Allow Form View: No
Allow Datasheet View: Yes

However, the form still opens in Form View! What do I have to do to
enforce Datasheet View?


I'm guessing this only happens when you open the form with code, using
DoCmd.OpenForm. Right? When you use DoCmd.OpenForm to open a form, as
opposed to doing it via the Access user interface, you must specify that
you want to open the form in anything other than form view; e.g.,

DoCmd.OpenForm "MyPopupForm", acFormDS

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


  #3  
Old June 10th, 2004, 12:42 PM
John Milbury-Steen
external usenet poster
 
Posts: n/a
Default disable datasheet view in form


I'm guessing this only happens when you open the form with code, using
DoCmd.OpenForm. Right?


I didn't write any code to open the form. I open the form via a button.


  #4  
Old June 10th, 2004, 03:45 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default disable datasheet view in form

"John Milbury-Steen" wrote in message

I'm guessing this only happens when you open the form with code,
using DoCmd.OpenForm. Right?


I didn't write any code to open the form. I open the form via a
button.


The button is using either VBA code or a macro to open the form. Was
the button created by the Command Button Wizard? If so, it will have
code for its Click event that looks something like this:

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form1"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub

(where "Command0" is the name of the button, and "Form1" is the name of
the form being opened). What you would need to do is edit this code and
change this line:

DoCmd.OpenForm stDocName, , , stLinkCriteria

to this:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

That should do it. Do you know how to get at the button's code to edit
it?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.