I am intending to use the code below to insert a record into the database. However, it is throwing an object required error. I have checked and all the variables contain data.
Dim vblMealType As String
Dim vblMealQual As String
If txtMealID.ItemsSelected.Count = 0 Then
        MsgBox "Please Select a Meal Type", _
               vbOKOnly + vbInformation
Else
 MsgBox "Customer Charge Succesfull.", _
              vbOKOnly + vbInformation
Dim qdf As DAO.QueryDef
 ERROR ON THE VALUES LINE
Set qdf = dbs.CreateQueryDef("", _
        "PARAMETERS prmCustomerID Text(255), prmMealID Text(255), prmTransactionAmount Currency, prmTransactionDate Text(255);" & _
        "INSERT INTO dbo_Transactions (CustomerID, MealID, TransactionAmount, TransactionDate) " & _
        "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
IfandElsebut noEnd If. Does your code compile?Option Explicit, then run Debug->Compile and clean up anything the compiler complains about. Then see what problem remains and post a question about that problem.txtMealID.ItemsSelected.Countand latertxtMealID.Value. So what istxtMealID: text; combo; or list box?