[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 669
  • Last Modified:

Left Outer Join SQL query Problem for Form source

Is is possible to use LEFT OUTER JOIN queries as a form source reliably in access?
whilse I can query the data, I am having all sorts of problems adding new records & editing records.

The SQL im trying to use is as follows.

SELECT id, acccode, tblPricing.itemcode, price, qty, tagqty, tag, blocked, description, unitsize, lastcost, gstcode FROM tblPricing LEFT OUTER JOIN tblTmpthinkpadinventory ON tblPricing.itemcode = tblTmpthinkpadinventory.itemcode WHERE tblPricing.acccode = 'ACAANN' ORDER BY tblPricing.itemcode, qty

the pricing table contains the records I want to edit/manage, the other table is just a stock file table that I am referencing the product descriptions from.

I get errors like the following when trying to edit or add.

"Method 'Fields' of Object _Recordset failed.

Thanks.

Jimby.
0
Jimby_Aus
Asked:
Jimby_Aus
2 Solutions
 
peter57rCommented:
Hello Jimby_Aus,

What happens when you compile your application?
Do you have the correct Library references - check Tools>References in Module design view.
If there are no problems with these then post the code that is giving problems.


Pete
0
 
Jimby_AusAuthor Commented:
Ive just compiled the application just to be sure, hasnt seem to made a difference.

Ive gotten rid of the left join query, replaced it with a simple SELECT statement, it now allows me to add records successfully, but some edits still fail with:

"Method 'Fields' of Object _Recordset failed."

Part of the problem may be related to the fact that I am assigning a dynamic recordsource to the form at runtime.
0
 
heer2351Commented:
Normally you would base the form on a query that only references tblPricing. Information required from table tblTmpthinkpadinventory can be added to the form using a subform; when multiple fields are required or a DLookup if you only require one field (or a small number of fields). Or depending on the application you could use a combo or listbox which rowsource references tblTmpthinkpadinventory.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now