Avatar of Nickon17
Nickon17Flag for United States of America

asked on 

Cannot Add New Record When Using A Left Join in Access

I am trying to add a a new record into my SQL 2000 table (using Access as the front end).  I have a left join between the route and stops table.  When I try and use the query tool in access, it does not allow be to add a new stop.  That is all I want to do it add a new stop to a route.  Please let me know what I am doing wrong.  I am passing the query using ADO (in case anyone needs know).  I DO NOT want to use split forms, this is all done through code.
SELECT Route.RouteID, Route.Route, STOPS.StopID, STOPS.STOP
FROM Route LEFT JOIN STOPS ON Route.Route = STOPS.ROUTE
WHERE (((Route.Route)="ABC"));

Open in new window

Microsoft AccessSQL

Avatar of undefined
Last Comment
Nickon17
Avatar of frankytee
frankytee
Flag of Australia image

i think you need to add OUTER ie
LEFT OUTER JOIN
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of fhlio_admin
fhlio_admin
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Nickon17
Nickon17
Flag of United States of America image

ASKER

The OUTER JOIN didn't wory, but both angelll and fhlio_admin are right, I cannot update with a LEFT JOIN.  What I ended up doing was using this query:
SELECT STOPS.STOP, STOPS.ROUTE, STOPS.STOPID FROM STOPS
and then manually assigning the value of stops.route (my joined field to route.route) with the value of route.route (I had a stored in a txt box on my form).  That worked for me, hope it helps someone else figure this out!
Avatar of Nickon17
Nickon17
Flag of United States of America image

ASKER

Thanks!  I am splitting the points because both answers were acurate, and did help me understand fully that what I was doing wasn't going to work.
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo