I've been out of VBA and access for months now, just hopping in to accomplish a quick little application, and I'm stuck....
I'm trying to use an ODBC adapter from Cdata to push information to a google calendar. I've got it hooked up, and I can read data within a DAO recordset, but .addnew isn't supported. So, I want to try to just insert with SQL. Please see my code below. I know the syntax is wrong on my strSQL, just can't figure out what it should be :banghead:
I'm trying to use an ODBC adapter from Cdata to push information to a google calendar. I've got it hooked up, and I can read data within a DAO recordset, but .addnew isn't supported. So, I want to try to just insert with SQL. Please see my code below. I know the syntax is wrong on my strSQL, just can't figure out what it should be :banghead:
Code:
Public Sub sInsertEvent(strSummary As String, strDescription As String, StartDate As Date)
'====================================================================
' Comments: Inserts a new event into the google calendar
' State of Code: Under Development
' Params :
' Returns :
' Created : 05/29/2015 12:55 PM GB
' Modified:
'====================================================================
'ErrorEnablerStart
On Error GoTo PROC_ERR
'ErrorEnablerEnd
Dim strSQL As String
Dim EndDate As Date
EndDate = StartDate + 1
strSQL = "INSERT INTO [GoogleApps_CalendarEvents] (CalendarId,Summary," & _
"Description,AllDayEvent,StartDateTime,EndDateTime) VALUES (" & _
"'schedule@atest.com',strSummary,strDescription,True,StartDate," & _
"EndDate"
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError
'====================================================================
'ErrorHandlerStart
EXIT_PROCEDURE:
Exit Sub
PROC_ERR:
MsgBox Err.Description, vbCritical, "mGoogleApps.sInsertEvent"
Resume EXIT_PROCEDURE
'ErrorHandlerEnd
End Sub