Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending Data to Database Code Doesn't Work with Outlook 2003

1 view
Skip to first unread message

pete.t...@twc.state.tx.us

unread,
May 30, 2006, 3:03:45 PM5/30/06
to
Afternoon, for the last several years I have been using (officewide) an
Outlook 97 form to send data to the Manger. When she recieves the Form,
she evaluates what is needed and either forwards the form to a
department , or clicks a button on the form which activates a code that
collects specific data from the form and post a record to an Access 97
Database.

Well, we just upgraded to Office 2003, and now my handy dandy little
form just doesn't want to do anything- that's the clicking of the
button-- does nothing, nor even an error message.

So I need to redesign, or twik the form for use with the new Outllok
2003, any suggestions as how to do this easily, or will it require my
learning new code? Here's my current code:

Sub ProcessButton1_Click()

' VB Script for Claims Notification Forms
' 07/27/04 by P.Trudell

' Database objects
Dim rst
Dim dao
Dim wks
Dim db

' Form Objects
Dim DateRec
Dim SSN
Dim Remarks
Dim BackDated
Dim ReIssue
Dim ReturnWk
Dim RWDate

' Oject Controls
Dim objPage
Dim objControls

Set objPage = Item.GetInspector.ModifiedFormPages("Message")
Set objControls = objPage.Controls
Set SSN = objControls("SSN")
Set Remarks = objControls("Remarks")
Set Sender = objControls ("Sender")
Set BackDated = objControls ("BackDated")
Set ReIssue = objControls ("ReIssue")
Set ReturnWk = objControls ("ReturnWk")
Set RWDate = objControls ("RWDate")

Set dao = Application.CreateObject("DAO.DBEngine.36")
Set wks = dao.Workspaces(0)
Set db = wks.OpenDatabase("\\Our server\selected database.MDB")
Set rst = db.OpenRecordset("reissue")
rst.AddNew
rst.SSN = SSN.Value
rst.BackDated = BackDated.Value
rst.ReIssue = ReIssue.Value
rst.ReturnWk = ReturnWk.Value
rst.RWDate = RWDate.Value
rst.From = Sender.Value
rst.Remarks = Remarks.Value
rst.Update
MsgBox "Update Complete."
rst.Close
db.Close

End Sub


Appreciate any help with this, Thanks

0 new messages