Solved

Exporting form data to Access

Posted on 2001-06-17
2
162 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

773 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