Position subform to new record when opened ?

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have a tabbed form where one tab shows a subform that
lists comments. The user wants to be immediately
positioned to enter a new comment after clicking this tab.
How would I do that? I'm confused about what event to put
the code in.
 
David,

Yes, this is a bit obscure.

Put the equivalent of this code on the OnChange event of the Tab
Control...

If Me.NameOfYourTabControl = x Then
Me.NameOfCommentsSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
End If
.... where x is an integer which is the value of the Page Index
property of the tab that holds the comments.

Having said that, another option is to simply set the DataEntry
property of the form which is used as the subform to Yes... depends
whether you want to be able to scoll back and see previous entries.

- Steve Schapel, Microsoft Access MVP
 
Back
Top