S
shaggles
I keep getting an error message that says "Query input
must contain at least one table or query" when I try to
run the following SQL statment in VB:
DoCmd.RunSQL "INSERT INTO Tracking1 ( Name, SS, [Date of
Birth], [Residence Address], [Residence City], [Residence
State], [Residence Zip], [Residence Phone], [Business
Phone], BID, MID, Status, Position )" & _
"SELECT [Credit-New].Name, [Credit-New].NID, [Credit-
New].Birthdate, [Home Address 1] & "" "" & [Home Address
2] AS [Home Address], [Credit-New].[Home City], [Credit-
New].[Home State], [Credit-New].[Home Postal], [Credit-
New].[Home Phone], [Credit-New].[Business Phone],
[Branches with DSM].BID, ""133"" AS MID, ""P"" AS
Status, ""Credit/Life"" AS Position" & _
"FROM [Credit-New] INNER JOIN [Branches with DSM] ON
[Credit-New].Location = [Branches with DSM].MailCode" & _
"WHERE ((([Credit-New].[Job Code]) In
(""srgh0"",""srgh1"",""srdq1"",""srdq2"",""srdq3"",""crsv5"
",""crsv6"")))"
I can't figure out what's wrong with it. It runs fine as
a SQL query outside of VB. What am I doing wrong?
must contain at least one table or query" when I try to
run the following SQL statment in VB:
DoCmd.RunSQL "INSERT INTO Tracking1 ( Name, SS, [Date of
Birth], [Residence Address], [Residence City], [Residence
State], [Residence Zip], [Residence Phone], [Business
Phone], BID, MID, Status, Position )" & _
"SELECT [Credit-New].Name, [Credit-New].NID, [Credit-
New].Birthdate, [Home Address 1] & "" "" & [Home Address
2] AS [Home Address], [Credit-New].[Home City], [Credit-
New].[Home State], [Credit-New].[Home Postal], [Credit-
New].[Home Phone], [Credit-New].[Business Phone],
[Branches with DSM].BID, ""133"" AS MID, ""P"" AS
Status, ""Credit/Life"" AS Position" & _
"FROM [Credit-New] INNER JOIN [Branches with DSM] ON
[Credit-New].Location = [Branches with DSM].MailCode" & _
"WHERE ((([Credit-New].[Job Code]) In
(""srgh0"",""srgh1"",""srdq1"",""srdq2"",""srdq3"",""crsv5"
",""crsv6"")))"
I can't figure out what's wrong with it. It runs fine as
a SQL query outside of VB. What am I doing wrong?