This is the code that is working. Thank you.
Private Sub cmdUpdate_Click()
Dim strSQL As String
strSQL = "UPDATE Students SET Students.UpdateWorkshop = -1 "
strSQL = strSQL & "WHERE Students.[ID] IN "
strSQL = strSQL & "(SELECT TOP " & CLng(Me.Textbox1) & " [ID] FROM Students As S " ' select...
This is the latest SQL statement
UPDATE Students SET Students.UpdateWorkshop = -1 WHERE Students.[ID] IN (SELECT TOP 5 [ID] FROM Students As S WHERE ([S.UpdateWorkshop]=false) AND ([S.Workshop]=Null) AND ([S.Major] In ('BADM', 'PBA')) AND ([S.Session]='1'));UPDATE Students SET...
I had a feeling that UpdateWorkshop checkbox value should be true or -1 or 0
Here is the result from the Immediate window for debug.print strSQL
UPDATE Students SET Students.UpdateWorkshop = -1
WHERE Students.[ID] IN (SELECT TOP 5 [ID] FROM Students As S
WHERE ([S.UpdateWorkshop]=false)...
Current error message: Run Time Error 3464: Data Type Mismatch in criteria expression. My questions are below Module1 code
A value is entered in the Textbox1 (on a subform) and a button run this code and fails due to Run Time Error 3464: Data Type Mismatch in criteria expression
Private Sub...
I want to thank each coder that has been assisting me. This underlying thread is not solved but I marking this thread solved. I will be opening new thread with details of the current direction of this issue.
Again, thank you
Access 2016. As I am working in Access 2016 MS Visual Basic for Applications soI am not sure where my references window is. Here is my workspace showing the Function fExecuteQuery.... below is the same space for the for the cmdUpdate code.
You called it right. There were two modules with the same code. Now when I trigger Module1 fExecuteQuery....., results in a compile error. user-defined type not defined (these lines are highlighted when the error message dialog appears).
Function fExecuteQuery(strQuery As String, _...