If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Trying to open a form in Acces by the click of a button in Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-18-04, 12:53
AnshBin AnshBin is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
Question Trying to open a form in Acces by the click of a button in Excel

I am working on a project in which I want to be able to click a button on excel and by the click of the button, a specfic access database should open and a form in access should automatically open. Please advice and help. I have already created the button in excel which opens access database, but how do I get it to open a specific access database and that too a form in access?

thanks.
Reply With Quote
  #2 (permalink)  
Old 03-18-04, 16:10
Philem Philem is offline
Registered User
 
Join Date: Nov 2003
Posts: 9
Hullo. This should not be too difficult. Create a macro in said database to display the form in question. Then, in Excel, modify the code that launches your Access instance. Put this: databasename.mdb /X MacroName at the END of that line, (just after Access.EXE). This will launch the database you name, and run the macro called for.

HTH

P
Reply With Quote
  #3 (permalink)  
Old 03-18-04, 18:06
AnshBin AnshBin is offline
Registered User
 
Join Date: Mar 2004
Posts: 2
Quote:
Originally posted by Philem
Hullo. This should not be too difficult. Create a macro in said database to display the form in question. Then, in Excel, modify the code that launches your Access instance. Put this: databasename.mdb /X MacroName at the END of that line, (just after Access.EXE). This will launch the database you name, and run the macro called for.

HTH

P
Thanks for your reponse, first of all I have created a button on excel but I am not able to open the acess database for some reason. I have placed the database in C:\testing.mdb, the code that I have to open the database by clicking the button in excel is as follows and doesn't seem to be working? can u please help. thanks

Private Sub Button351_Click()
On Error GoTo Err_Button351_Click

Dim stAppName As String

stAppName = "Access.mdb c:\jaim.mdb"
Call Shell(stAppName, 1)

Exit_Button351_Click:
Exit Sub

Err_Button351_Click:
MsgBox Err.Description
Resume Exit_Button351_Click

End Sub

This appears in excel to open the jaim.mdb database. it cliams file not found. can u provide a i.e if not much trouble. Thanks.
Reply With Quote
  #4 (permalink)  
Old 03-23-04, 17:14
bailee220 bailee220 is offline
Registered User
 
Join Date: Oct 2003
Posts: 29
' This just turns on and off alerts about overwirting a file
Application.DisplayAlerts = True

'This is where you set up your directory. I have a network directory set up here with the database name at the end called Error Log Database.mdb.

Const strConPathToSamples
"\\Maverick\sfactory\SolFactory\Development_Factor y\Projects\Transformation Project\Quick Tools\Tool Development\Error Log\Error Log Database.mdb"


strDB = strConPathToSamples & "Error Log Database.mdb"


' Create new instance of Microsoft Office Access.
Set appAccess = CreateObject("Access.Application")

' Open database in Microsoft Office Access window. appAccess. OpenCurrentDatabase strConPathToSamples


' Open form.
'You can't forget to make the database visible. If you forget this. If you went to where the database is on the drive, you'll notice the .ldb was created meaning that the database is opened, you just can't see it.

appAccess.Visible = True



Hope this helps!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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