Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a marco in Excel to go to a form in MS ACCESS
Form: Frm001 DataBase: c:\data\Sales.mdb the form was opened already. Dennis |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dennis,
If what you want is a macro that opens a form from within Excel try this. Dim appAccess As Access.Application Sub DisplayForm() FindRef = ActiveCell 'when it open the form it will look for this in the first field 'if you don't want to look for anything omit this line On Error GoTo Error_Handler ' Initialize string to database path. Const strConPathToSamples = "YOUR PATH\DATABASEFILENAME.mdb" ' Create new instance of Microsoft Access. Set appAccess = _ CreateObject("Access.Application") ' Open database in Microsoft Access window. appAccess.OpenCurrentDatabase strConPathToSamples ' Open form. DoCmd.OpenForm "FORMNAME", acNormal, "", "", , acNormal DoCmd.FindRecord FindRef, acEntire, False, , False, acCurrent, True 'omit this line if you don;t want to find a particular record & just want to open the form Exit Sub Error_Handler: appAccess.Visible = False MsgBox "No data found" appAccess.Quit acQuitSaveNone 'change to save or prompt where necessary End End Sub -- You'll need to amend it, filename, formname, etc to your needs and make sure the error handling meets your needs. _______________________ Naz, London "Dennis Cheung" wrote: I need a marco in Excel to go to a form in MS ACCESS Form: Frm001 DataBase: c:\data\Sales.mdb the form was opened already. Dennis |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Access Form In An Access Report (SubForm) Question | Links and Linking in Excel | |||
Goto an Access Form | Excel Programming | |||
Go to an Access form | Excel Programming | |||
On Error Goto doesn't goto | Excel Programming | |||
On Error Goto doesn't goto | Excel Programming |