D
David M via AccessMonster.com
I have a form with a command button 'cmdXfer'.
In the procedure for cmdXfer_Click I have the following code (among other
code):
DBEngine.Workspaces(0).BeginTrans
CurrentDb.Execute "INSERT INTO [tjctDistributions] (" & _
"fkautLeadID, fkautSaleID, intDistrNum, dtmDistrDate, "
& _
"fkstrDistrType, dtmXfered, fkautEmployeeID,
strBrokerName, " & _
") VALUES (" & _
Me.pkautLeadID & ", " & _
Me.cboSaleID & ", " & _
intNextDistrNum & ", " & _
pfGetSQLDate(Now()) & ", " & _
"'XML', " & _
pfGetSQLDate(Me.txtDateXfered) & ", " & _
Me.cboEmployeeID & ", " & _
"'" & Me.txtBrokerName & "'" & _
")", dbFailOnError
DBEngine.Workspaces(0).CommitTrans
I'm getting 'COMPILE ERROR: SUB OR FUNCTION NOT DEFINED'' on each of the 'Me.
' references. They are definitely valid fields/controls on the current form.
They even appear automatically after typing 'Me.'. If I substitutute (hard-
code) a number for any of them, the error moves past to the next 'Me.'
reference. If I type them with the field names but without the actual 'Me.'
then I still get the same error.
Thanks in advance for your help,
David
In the procedure for cmdXfer_Click I have the following code (among other
code):
DBEngine.Workspaces(0).BeginTrans
CurrentDb.Execute "INSERT INTO [tjctDistributions] (" & _
"fkautLeadID, fkautSaleID, intDistrNum, dtmDistrDate, "
& _
"fkstrDistrType, dtmXfered, fkautEmployeeID,
strBrokerName, " & _
") VALUES (" & _
Me.pkautLeadID & ", " & _
Me.cboSaleID & ", " & _
intNextDistrNum & ", " & _
pfGetSQLDate(Now()) & ", " & _
"'XML', " & _
pfGetSQLDate(Me.txtDateXfered) & ", " & _
Me.cboEmployeeID & ", " & _
"'" & Me.txtBrokerName & "'" & _
")", dbFailOnError
DBEngine.Workspaces(0).CommitTrans
I'm getting 'COMPILE ERROR: SUB OR FUNCTION NOT DEFINED'' on each of the 'Me.
' references. They are definitely valid fields/controls on the current form.
They even appear automatically after typing 'Me.'. If I substitutute (hard-
code) a number for any of them, the error moves past to the next 'Me.'
reference. If I type them with the field names but without the actual 'Me.'
then I still get the same error.
Thanks in advance for your help,
David