Solved

Exporting form data to Access

Posted on 2001-06-17
2
165 Views
Last Modified: 2010-04-08
I have created an outlook form that contains a number of text boxes and a command button. On clicking the command button, I would like to export the text values directly into an Access table.

Can any one tell me what coding I need to use in the Command Button.

Any help on this will be much appreciated.

Thanks in anticipation.
0
Comment
Question by:markbriggs
2 Comments
 
LVL 9

Accepted Solution

by:
rjcpjc earned 100 total points
ID: 6200619
Here's a link and some sample code:

http://www.slipstick.com/dev/database.htm

-----

Sub cmdButtonName_Click()

'Set variables for database connection

Set dbe = CreateObject("ADODB.Connection")
Set rst = CreateObject("ADODB.Recordset")

blnFound = False

dbe.Mode = 3
dbe.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Windows\Desktop\dbname.mdb;"
strSQL = "SELECT * FROM AddressInformation;"
rst.Open strSQL,dbe,2,3
rst.MoveFirst

rst.AddNew

rst.Fields("FieldName") = Item.UserProperties.Find("fieldname").value
'continue for all fields you want to write to the database

rst.Update

rst.Close
dbe.Close

Set rst = Nothing
Set dbe = Nothing

End Sub

--------

Hope this helps.  If you need more assistance, post back.

--PatriciaC
0
 

Author Comment

by:markbriggs
ID: 6204029
Spot on.  Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
Read this checklist to learn more about the 15 things you should never include in an email signature.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question