access open another db & form on last record

I have a button on my switchboard that opens  a second database.  I would like the second database to open on a paticular form & the last record of the form.  Here is the query for opening the second db:

Private Sub Command54_Click()
Dim strDB As String, appAccess As Access.Application
    strPath = "\\Fileserver\is_data\Documentation\IT-Private\Scheduling DB\WIP\3-25-10 WIP\"
    strDB = strPath & "Schedulingdb_ShipSplitBatch.accdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB
    appAccess.Visible = True
    appAccess.UserControl = True '
End Sub

Any suggestions?
johnmadiganAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
Private Sub Command54_Click()
Dim strDB As String, appAccess As Access.Application
    strPath = "\\Fileserver\is_data\Documentation\IT-Private\Scheduling DB\WIP\3-25-10 WIP\"
    strDB = strPath & "Schedulingdb_ShipSplitBatch.accdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB
    appAccess.Visible = True
    appAccess.UserControl = True '

   appAccess.docmd.openform "formX" ' add this line  
End Sub
0
iandianCommented:
if your table on which the form is based has a field, e.g. named "date", with the date of creation for a record you can add this to reverse the order (get the last record)

appAccess.Forms.Item("FormX").OrderBy("date DESC")

the same can be done with an autonumber field, e.g named "ID"

appAccess.Forms.Item("FormX").OrderBy("ID DESC")
0
Rey Obrero (Capricorn1)Commented:
Private Sub Command54_Click()
Dim strDB As String, appAccess As Access.Application
    strPath = "\\Fileserver\is_data\Documentation\IT-Private\Scheduling DB\WIP\3-25-10 WIP\"
    strDB = strPath & "Schedulingdb_ShipSplitBatch.accdb"
    ' Create new instance of Microsoft Access.
    Set appAccess = CreateObject("Access.Application")
    ' Open database in Microsoft Access window.
    appAccess.OpenCurrentDatabase strDB
    appAccess.Visible = True
    appAccess.UserControl = True '

   appAccess.docmd.openform "formX" ' add this line  s
   appAccess.docmd.gotorecord,,aclast
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
iandianCommented:
ah yeah my bad, that would be easier.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.