G
Guest
I need to trim two text fields, concatenate them with a slace ("/") in the
middle and then update it back to the table. But I'm getting a Run-time error
'13': Type mismatch,
on the third SQL1 assignment.
Dim db As Database
Dim SQL1 As String
Set db = CurrentDb
SQL1 = "INSERT INTO tblTemp ( Invoice, PO, PartNumber, ShipDate, ShipQty,
UnitPrice ) "
SQL1 = SQL1 & " SELECT Import.Invoice, Import.PO, "
SQL1 = SQL1 & "IIf(IsNull([Import]![Rev]),
Trim([Import]![PartNumber]),Trim([Import]![PartNumber]) & " / " &
Trim([Import]![Rev])) AS PartNumber, "
'error in previous line
SQL1 = SQL1 & "Import.ShipDate, Import.ShipQty, Import.UnitPrice "
SQL1 = SQL1 & " FROM Import"
db.Execute SQL1
db.Close
I'm suspecting there's something wrong with the IIF... statement.
I'm working too late to get this resolved! Any help is very much
appreciated. Thanks in advance
middle and then update it back to the table. But I'm getting a Run-time error
'13': Type mismatch,
on the third SQL1 assignment.
Dim db As Database
Dim SQL1 As String
Set db = CurrentDb
SQL1 = "INSERT INTO tblTemp ( Invoice, PO, PartNumber, ShipDate, ShipQty,
UnitPrice ) "
SQL1 = SQL1 & " SELECT Import.Invoice, Import.PO, "
SQL1 = SQL1 & "IIf(IsNull([Import]![Rev]),
Trim([Import]![PartNumber]),Trim([Import]![PartNumber]) & " / " &
Trim([Import]![Rev])) AS PartNumber, "
'error in previous line
SQL1 = SQL1 & "Import.ShipDate, Import.ShipQty, Import.UnitPrice "
SQL1 = SQL1 & " FROM Import"
db.Execute SQL1
db.Close
I'm suspecting there's something wrong with the IIF... statement.
I'm working too late to get this resolved! Any help is very much
appreciated. Thanks in advance