D
David
Hello,
I am trying to convert some of my queries to SQL so that I can place them
into code. One query changes an product identifier that has dashes in it
(pniin) to a product identifier without the dashes (NIIN). The data resides
in a table called Batch1.
The SQL for the query is: SELECT Batch1.pniin, Replace([pniin],"-","") AS
NIIN
FROM Batch1;
My code reads: Private Sub Command235_Click()
On Error GoTo Err_Command235_Click
SQL = "SELECT Batch1.pniin, Replace([pniin]," - ","") AS NIIN FROM
Batch1;"
DoCmd.RunSQL SQL
Exit_Command235_Click:
Exit Sub
Err_Command235_Click:
MsgBox Err.Description
Resume Exit_Command235_Click
End Sub
I get Type Mismatch error when this runs. Sorry for being long winded but I
cannot figure out how to fix this. Please help!
I am trying to convert some of my queries to SQL so that I can place them
into code. One query changes an product identifier that has dashes in it
(pniin) to a product identifier without the dashes (NIIN). The data resides
in a table called Batch1.
The SQL for the query is: SELECT Batch1.pniin, Replace([pniin],"-","") AS
NIIN
FROM Batch1;
My code reads: Private Sub Command235_Click()
On Error GoTo Err_Command235_Click
SQL = "SELECT Batch1.pniin, Replace([pniin]," - ","") AS NIIN FROM
Batch1;"
DoCmd.RunSQL SQL
Exit_Command235_Click:
Exit Sub
Err_Command235_Click:
MsgBox Err.Description
Resume Exit_Command235_Click
End Sub
I get Type Mismatch error when this runs. Sorry for being long winded but I
cannot figure out how to fix this. Please help!