Hi there,
I have a problem with my program. Indeed, when I launch it, the error is "Data mismatch is this criteria". You can see the following code:
Apparently the problem is about "UNION ALL"...
But the code isn't false!
Someone advices me to create a Temp table instead of " UNION ALL".
Does it the right thing to do?
How can I do that?
Thanks a lot!
I have a problem with my program. Indeed, when I launch it, the error is "Data mismatch is this criteria". You can see the following code:
Code:
Sub MotherPacketOP(MNbr As String, LATDT As String, CLDT As String, PRVAL As String, ASTDT As String)
Dim strSQL1 As String
Dim rst As DAO.Recordset
Dim rst1 As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Operations")
strSQL1 = "SELECT AMFLIBP_MOHRTG.* "
strSQL1 = strSQL1 & "FROM AMFLIBP_MOHRTG "
strSQL1 = strSQL1 & "WHERE (((AMFLIBP_MOHRTG.ORDNO)='" & MNbr & "') AND ((AMFLIBP_MOHRTG.CLDT)=" & CLDT & ")) "
strSQL1 = strSQL1 & "UNION ALL SELECT AMFLIBP_MOROUT.* "
strSQL1 = strSQL1 & "FROM AMFLIBP_MOROUT "
strSQL1 = strSQL1 & "WHERE AMFLIBP_MOROUT.ORDNO='" & MNbr & "' AND AMFLIBP_MOROUT.PRVAL='" & Nz(PRVAL, "") & "' "
strSQL1 = strSQL1 & "ORDER BY OPSEQ;"
Debug.Print strSQL1
Set rst1 = CurrentDb.OpenRecordset(strSQL1, dbOpenDynaset) 'just collect the information of the Operations tables and enter same name in the normal and extra field
Apparently the problem is about "UNION ALL"...
But the code isn't false!
Someone advices me to create a Temp table instead of " UNION ALL".
Does it the right thing to do?
How can I do that?
Thanks a lot!