How to display the access form in the excel form

dhaya123

Registered User.
Local time
Today, 07:31
Joined
Dec 14, 2013
Messages
13
Hi Everyone,

I have created a MS access form having a combobox,button.
There I have coded like : When the user click on button,a report will be generated.

My requirement:

I need to show the access form in the excel form.

I have searched and got code,which only allows me to open the ms access not the form.

Could anyone help me on this plzzz

Thanks in advance
 
Could you show a "picture" of what result you want, (I've trouble imagining an Access form in an Excel form and how you think it would looks like. :))?

Show also the code you have mention in your post?
 
I have attached the access screen
 

Attachments

  • access screen.PNG
    access screen.PNG
    83.2 KB · Views: 177
Hmm - do mean how to get a form in MS-Access looks like a form in Excel, instead of insert a the access form in a Excel form?
If your want the form shown when your open the database, then set "Display Form" to your form name for the "Current Database" under MS-Access "Option".
If it is not that, then you need to explain more precisely what it is you are having trouble with.
attachment.php
 

Attachments

  • Option.jpg
    Option.jpg
    41.3 KB · Views: 406
Thanks for the reply,

My requirement is:
I have to generate a report when the user clicks the form designed in the excel where I have used MS access as a Back end.

So I created a form in MS access which pulls the report.

I am stuck on the place where I planned to call the access form in the excel code.

Please let me know whether you need further info
 
Okay now I got it, (remember to change the path and the form name)! :)
Try the below code.
Code:
Dim oApp As Object

Private Sub CommandButton1_Click()
  Dim LPath As String
  Dim LCategoryID As Long
  
  'Path to Access database
  LPath = "C:\YourPathToTheDatabase\YourDatabaseNameAndExtension"
  
  'Open Access and make visible
  Set oApp = CreateObject("Access.Application")
  oApp.Visible = True
  
  'Open Access database as defined by LPath variable
  oApp.OpenCurrentDatabase LPath
  
  'Open the form
  oApp.DoCmd.OpenForm "YourFormName"
   
End Sub
 
Inserting multiple values

Hi,

Could any one tell me how to insert a multiple values in vba.
I tried but dnt get solution
CharName = ComboBox1.Value
Created = TextBox1.Value
Modu = TextBox3.Value
'Connection String
Set objConnection1 = CreateObject("ADODB.Connection")
Set objRecordset1 = CreateObject("ADODB.Recordset")
objConnection1.Open _
"Provider = Microsoft.ACE.OLEDB.12.0; " & _
"Data Source = source"




Set cmd = CreateObject("ADODB.Command")
Set cmd.ActiveConnection = objConnection1
cmd.CommandText = " [COLOR=#0000ff !important]INSERT INTO ScenDetails[/COLOR] (Charter,PreparedBy,Module) VALUES ('" & CharName & "', '" & Created & "', '" & Modu & "' )"
'cmd.Execute


'Displaying in List Box
Set objRecordset1 = Nothing
objConnection1.Close
Set objConnection1 = Nothing


please help on this...
 

Users who are viewing this thread

Back
Top Bottom