Sorry for the sloppyness, but this is my first attemp at
this type of programming. I used msgBox to let me know
when sertain functions were performed. For some
explained reason debug does not work. That is another
day. I did find a thread pertaining to that back on
Mar30 and will address that soon.
Thanks again.
Function Item_Open()
Set cnNorthwind = CreateObject("ADODB.Connection")
MsgBox "1a"
cnNorthwind.ConnectionString
= "Provider=SQLOLEDB.1;Persist Security Info=True;User
ID=sa;Initial Catalog=TransactionLayer;Data Source=CRE03"
MsgBox "#1b"
' Open connection
cnNorthwind.Open
MsgBox "#1c"
Set cmNorthwind = CreateObject("ADODB.Command")
MsgBox "#1c1"
'Set command connection
cmNorthwind.ActiveConnection = cnNorthwind
MsgBox "#1d"
End Function
'****************************************************** ***
*********************
'* Procedure: Item_CustomPropertyChange(byVal Name)
'* Description: You use a custom property change
event to respond to a change
'* in order. You can't use the
control's intrinsic events. These events
'* currently do not fire in the
VBScript of an Outlook form.
'****************************************************** ***
*********************
' This is good code
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "OrderNo"
MsgBox "Property Change to Order"
' Set values
Call cmdSetoutValues
End Select
End Sub
Sub cmdSetoutValues()
'This is good code
MsgBox "Begin data change"
Set rstOrd = CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM ord WHERE OrdNum = 666926"
'strSQL = "SELECT * FROM ord WHERE OrdNum = " '& Chr (39)
& OrderNo & Chr(39)
MsgBox "SQL Order"
rstOrd.Open "ord", cnNorthwind
MsgBox "Select" & strSQL
MsgBox "My Set State is = " & adStateOpen
MsgBox "My File State is = " & rstOrd.State
With rstOrd
.MoveFirst
MsgBox "Record moved"
If .State = adStateOpen Then
MsgBox "Begin Data population"
Item.UserProperties("CustomerName") = "Dale"
' Item.UserProperties("CityState") = "OFallon"
'Item.UserProperties[CustomerName] = ShipToCustNm
MsgBox "Data population #1"
Item.UserProperties("CityState") =
ord.ShipToAddrTxt
Item.UserProperties("pono") = ord.PONum
Item.UserProperties("CUSTOMER") =
ord.ShipToCustNum
MsgBox "variables Customer is " & CustomerName
MsgBox "variables City is " & CityState
MsgBox "Name & City to be Changed"
MsgBox "Name & City Changed"
Else
MsgBox "rstOrdstate did not work "
Item.UserProperties("CustomerName") =
ord.ShipToCustNm
Item.UserProperties("CityState") =
ord.ShipToAddrTxt
Item.UserProperties("pono") = ord.PONum
Item.UserProperties("CUSTOMER") =
ord.ShipToCustNum
' Item.UserProperties("CustomerName")
= "Namedidnotwork"
' Item.UserProperties("CityState")
= "Citydidnotwork"
End If
End With
End Sub
-----Original Message-----
The syntax for the Outlook side is always the same:
Item.UserProperties("CustomerName")
What code are you using to connect to the database