Hi All,
I have database in which I have data table called commentary table now I created a userform to input/modify data in the same table the form has 1 Combobox which contains a list of products populated from the product column of the datatable same way there is dtpicker which is updated with the "Data as of date" column of data table and a commentary box which is textbox .i.e. text15 which gets populated with the commentary column data from the data table. Now this form will be used like this .i.e. everyday product guys will select their respective product in combobox on form and then remove the last entered commentary from commentary box .i.e. text15 and update new commentary and select new date in the dtpicker and then click on a command button .i.e. submit commentary which is inserted on the form. Now I want this command button to function in such a way that it should update the commentary and the date selected by the product guys against his respective product in the datatable. I am using the below sql statement for the same but it's showing following error. Please help. Enclosed is my database file for your reference.
Error Msg: Run-time error '3464': Data type mismatch in criteria expression
Thanks a lot for your help in advance
I have database in which I have data table called commentary table now I created a userform to input/modify data in the same table the form has 1 Combobox which contains a list of products populated from the product column of the datatable same way there is dtpicker which is updated with the "Data as of date" column of data table and a commentary box which is textbox .i.e. text15 which gets populated with the commentary column data from the data table. Now this form will be used like this .i.e. everyday product guys will select their respective product in combobox on form and then remove the last entered commentary from commentary box .i.e. text15 and update new commentary and select new date in the dtpicker and then click on a command button .i.e. submit commentary which is inserted on the form. Now I want this command button to function in such a way that it should update the commentary and the date selected by the product guys against his respective product in the datatable. I am using the below sql statement for the same but it's showing following error. Please help. Enclosed is my database file for your reference.
Code:
Private Sub Command17_Click()
DoCmd.SetWarnings WarningsOff
Dim sSQL As String
sSQL = "UPDATE [Commentary Table] SET "
sSQL = sSQL & "[Commentary] = '" & Me.Text15 & "',"
sSQL = sSQL & "[Data As Of Date] = #" & Me.DTPicker1 & "# "
sSQL = sSQL & "WHERE (((ID)= '" & Me.Combo2 & "'))"
DoCmd.RunSQL sSQL
DoCmd.SetWarnings WarningsOn
End Sub
Thanks a lot for your help in advance
Attachments
Last edited: