Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form in Datasheet view only 1

Status
Not open for further replies.

cdgeer

IS-IT--Management
Apr 8, 2008
133
US
I have a cmd button that opens a form.
I used: DoCmd.OpenForm stDocName, acFormsDS, , stLinkCriteria
to have it open in datasheet view but it doesn't. In the properties the default view is set to datasheet and all the other allowviews are no. I also use the OnOpen event for the form for the following:
Private Sub Form_Open(Cancel As Integer)

Dim strTableName As String
Dim strSQL As String

strTableName = Forms![ADW Table Select].TableName
strSQL = "SELECT * FROM " & strTableName & " WHERE [EEID] = TRUE;"

Me.RecordSource = strSQL


End Sub

The form opens in form view but allows you to change to datasheet. How do I force it to open in datasheet only?


 
How are ya cdgeer . . .
Code:
[blue]   acForm[red]s[/red]DS
should be:
   acFormDS[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top