Help in Transfering Data from Access Form to Excel.

salem_beauty

New member
Local time
Today, 03:21
Joined
Jun 4, 2009
Messages
1
Hi All,
Not sure if i got the answer in this form. I'm knowledge is kind of limited in Access. I have user form which is used to get customer details and their order details. I also used subform it the same. For example, the form has customer details i.e, account number, name of the customer and their post code (record stored in customer table) a subform which hold the order details i.e, order number, order type, date and time, telephone numbers (record stored in order table). Users enter the data in the main and subform.
Now i need a command button perform a particular function. When the button is pressed, i want the data's which is entered in the main and subform should transfer to Excel. It will great if it can transfer the individual data to a specified cell the excel spreadsheet.

Pease someone help on this.
 
As a starter, the following code will define an Excel object. The objExcel object will then enable you to use and control Excel using VBA.

PHP:
Public objExcel As Excel.Application

'If Excel is already open Err.Number returns zero otherwise
'a new Excel session is created
Sub OpenExcel()
On Error Resume Next
Set objExcel = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
    Set objExcel = CreateObject("Excel.Application")
End If
On Error GoTo 0
objExcel.Visible = True   
End Sub

ps Make sure that you have the Microsoft Excel Object Library loaded
 

Users who are viewing this thread

Back
Top Bottom