MS Access / SQL : Invalid Use of Property <p>The code below is supposed to insert a new record into the transactions table. However, it results in a compile erro "Invalid Use of Property" on the SET QDF line. What could cause such an error?</p> <pre><code>Private Sub cmdCharge_Click() Dim vblMealType As String Dim vblMealQual As String Dim dbs As DAO.Database If txtMealID.ItemsSelected.Count = 0 Then MsgBox "Please Select a Meal Type", _ vbOKOnly + vbInformation Else MsgBox "Customer Charge Succesfull.", _ vbOKOnly + vbInformation Set dbs = CurrentDb Dim QDF As DAO.QueryDef QDF = dbs.CreateQueryDef("", _ "PARAMETERS prmCustomerID Text(255), prmMealID Text(255), prmTransactionAmount Currency, prmTransactionDate Text(255);" &amp; _ "INSERT INTO dbo_Transactions (CustomerID, MealID, TransactionAmount, TransactionDate) " &amp; _ "VALUES ([prmCustomerID], [prmMealID], [prmTransactionAmount], [prmTransactionDate])") QDF!prmCustomerID = txtCustomerID.Value QDF!prmMealID = txtMealID.Value QDF!prmTransactionAmount = txtCharge.Value QDF!prmTransactionDate = Date QDF.Execute dbFailOnError MsgBox "Customer Charge Succesfull.", _ vbOKOnly + vbInformation Set QDF = Nothing Set dbs = Nothing DoCmd.OpenForm "Charge Form" DoCmd.Close acForm, Me.Name End If End Sub </code></pre>