Solved

Exporting form data to Access

Posted on 2001-06-17
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
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…
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…

734 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