Form created as datasheet; displays as single form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RLN

    Form created as datasheet; displays as single form

    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_Cl ick()
    On Error GoTo Err_cmdDivCodes 2_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmDivisionCod es"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    Exit_cmdDivCode s2_Click:
    Exit Sub

    Err_cmdDivCodes 2_Click:
    MsgBox Err.Description
    Resume Exit_cmdDivCode s2_Click

    End Sub
    <end code>

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

    Thanks.
  • fredg@example.invalid

    #2
    Re: Form created as datasheet; displays as single form

    On 5 Feb 2004 12:40:30 -0800, rlnnewsgroup@ms n.com (RLN) wrote:
    [color=blue]
    >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_Cl ick()
    >On Error GoTo Err_cmdDivCodes 2_Click
    >
    > Dim stDocName As String
    > Dim stLinkCriteria As String
    >
    > stDocName = "frmDivisionCod es"
    > DoCmd.OpenForm stDocName, , , stLinkCriteria
    >Exit_cmdDivCod es2_Click:
    > Exit Sub
    >
    >Err_cmdDivCode s2_Click:
    > MsgBox Err.Description
    > Resume Exit_cmdDivCode s2_Click
    >
    >End Sub
    ><end code>
    >
    >Is there something wrong with the syntax of the Open Form statement?
    >
    >Thanks.[/color]

    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

    Comment

    Working...