Hi what I am trying to do is connect to Access from Outlook. I have tried several ways this way gets me part way there
' Initialize string to database path.
Const strConPathToSamples = "C:\Users\Doc.DENTAL\Documents\"
strDB = strConPathToSamples & "My New App.accdb"
' Create new instance of Microsoft Access.
Set appAccess = _
CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.OpenCurrentDatabase strDB
appAccess.DoCmd.RunSQL "UPDATE tblTest " _
& "SET Name = 'John' " _
& "WHERE ConfirmationCode= 2;"
I can run an update sql but I would also like to run a query based on information with in the subject
i.e. if the subject is xyz
I would like to be able to run a query that would look something like this
Dim rs As RecordSetSet rs = Currentdb.OpenRecordSet("SELECT *, ID FROM MyAccessTable where ConfirmationCode="SUBJECT LINE" ;")
Do While Not rs.EOF
'do some things
rs.MoveNext
Loop