Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

open nested subform to new blank record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
patti - 13 Jun 2007 10:41 GMT
I have a tabbed form. trying to get nested subform on 3rd tab to open to new
blank record, and want user to have ability to scroll previous records.

this is my code:

Private Sub Form_Load()

   Me!frmHospVisit!frmDailyData.SetFocus   'Set the focus to the nested
subForm
   DoCmd.GoToRecord , , acNewRec   'Move to new record
   [cboFindPatient].SetFocus   'Return to main form primary key field

End Sub

not opening frmDailyData to new record; still shows last record.

Thanks for the help.

patti
Scott McDaniel - 13 Jun 2007 11:40 GMT
>I have a tabbed form. trying to get nested subform on 3rd tab to open to new
>blank record, and want user to have ability to scroll previous records.
[quoted text clipped - 9 lines]
>
>End Sub

I think you'd be better using a Sub in the form's code module to move to the record. Depending on SetFocus to correctly
"point" your DoCmd argument is spotty, at best. Instead, include this in your subform's code:

Sub GoToNewRecord()
 DoCmd.RunCommand acCmdRecordsGoToNew
End Sub

Now call this in your code above:

Me.NameOfYourSubformCONTROL.Form.GoToNewRecord

Note the syntax: NameOfYourSubformCONTROL is the name of the subform control, and may or may not be the name of the form
being used as subform ... in your case, it's not clear whether your subform is frmHospVisit or frmDailyData (or if those
are even valid names for the subform control).

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.