By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Form created as datasheet; displays as single form

P: n/a
RLN
Re: Access 2000
I have a form (Form1) where the default view in the properties is set
to "Datasheet".
When I click on the Form1 object from the container to display it, it
displays fine in datasheet mode. However, when I click a button on
another form to display Form1, Form 1 is displayed as single form. I
need it to display Form1 in datasheet mode.

Here is my code in the click event that opens the form:

<begin code>
Private Sub cmdDivCodes2_Click()
On Error GoTo Err_cmdDivCodes2_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDivisionCodes"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdDivCodes2_Click:
Exit Sub

Err_cmdDivCodes2_Click:
MsgBox Err.Description
Resume Exit_cmdDivCodes2_Click

End Sub
<end code>

Is there something wrong with the syntax of the Open Form statement?

Thanks.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 5 Feb 2004 12:40:30 -0800, rl**********@msn.com (RLN) wrote:
Re: Access 2000
I have a form (Form1) where the default view in the properties is set
to "Datasheet".
When I click on the Form1 object from the container to display it, it
displays fine in datasheet mode. However, when I click a button on
another form to display Form1, Form 1 is displayed as single form. I
need it to display Form1 in datasheet mode.

Here is my code in the click event that opens the form:

<begin code>
Private Sub cmdDivCodes2_Click()
On Error GoTo Err_cmdDivCodes2_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDivisionCodes"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdDivCodes2_Click:
Exit Sub

Err_cmdDivCodes2_Click:
MsgBox Err.Description
Resume Exit_cmdDivCodes2_Click

End Sub
<end code>

Is there something wrong with the syntax of the Open Form statement?

Thanks.


Regardless of the Default View of a form, if you open it from a
command button on another form you must explicitly tell it to open in
datasheet view:

DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

--
Fred
Please respond only to this newsgroup.
I do not reply to personal email
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.