Link to home
Start Free TrialLog in
Avatar of NigelRocks
NigelRocks

asked on

What's Wrong with this Code?

Experts,

In the attached code, I'm passing in a form object and then building a SQL string based on controls on that form.  The line with "VALUES" in it tells me that the object "won't support this property or method".  What am I missing?
Public Function nInsertTaskFromForm(taskForm As Form)

    'bc1
    
    If taskForm.Name <> "frmTask" Then
        nInsertTaskFromForm = -1
        Exit Function
    End If
    
        ' insert record into TASKS table
    sSQL = "INSERT INTO Tasks "
    sSQL = sSQL + "(taskForm.Tasks_Description"
    sSQL = sSQL & ",taskForm.Tasks_Short_Desc"
    sSQL = sSQL & ",taskForm.Tasks_Start_Date"
    sSQL = sSQL & ",taskForm.Status) "
    sSQL = sSQL & "VALUES('" & taskForm.txtTaskDesc.Text & "'"
    sSQL = sSQL & ",'" & taskForm.txtTaskShortDesc.Text & "'"
    sSQL = sSQL & ",#" & taskForm.txtStartDate & "#"
    sSQL = sSQL & "," & CStr(geWorkStatus.Due) & ")"
    gdbKnowledgeTracker.Execute sSQL
    
    nNewTaskID = nGetMaxRecordIDFromTable(gdbKnowledgeTracker, "Tasks", "Task_ID")
    

End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Paul Thompson
Paul Thompson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Robin Uijt
Robin Uijt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial