Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Goto a form in MS ACCESS

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   Report Post  
Posted to microsoft.public.excel.programming
Naz Naz is offline
external usenet poster
 
Posts: 85
Default Goto a form in MS ACCESS

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Form In An Access Report (SubForm) Question Gary Links and Linking in Excel 0 January 27th 06 05:54 AM
Goto an Access Form Dennis Cheung Excel Programming 0 September 16th 05 04:21 PM
Go to an Access form Dennis Cheung[_3_] Excel Programming 0 September 15th 05 08:53 AM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM


All times are GMT +1. The time now is 01:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"