Solved

Exporting form data to Access

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

631 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