Today 02:08 PM
Phred
I am getting a data type mismatch on my append query. I printed out the results of the query in the immediate window -- at bottom. The variables pick up correctly from a form and the query shows the correct info is being processed.
I can't seem to find the mismatch. My variables are Integers, the table number fields are Long Integer.
Dim intCatID As Integer, stCatName As String, intMealId As Integer, dtDateAssigned As Date, stMealName As String, stSQL As String,
My table fields match as to data type, I think.
stSQL = "INSERT INTO Tbl_ScheduledMeal" _
& "( CategoryID, DayAssigned, CategoryName, MealID, MealName )" _
& "VALUES (" & intCatID & ", #" & dtDateAssigned & "#,'" & stCatName & "'," & intMealId & ",'" & stMealName & "');"
Results of Immediate window show the data is correct. I must have a problem with my table but I can't see where the problem is.
See attached pic of table fields.
INSERT INTO Tbl_ScheduledMeal( CategoryID, DayAssigned, CategoryName, MealID, MealName )
VALUES (7, #1/27/2012#,'BOX LUNCH - PRESCHOOL',142,'Banana Muffin - Preschool');