Forum Discussion

cfarri's avatar
cfarri
Copper Contributor
Aug 02, 2022

Linking an external query to a field in a form

I have a form where the record source is a query joining several tables. There is a field for location (NationalGridReference). I have an external query (NGR_to_XY) which converts NationalGridReference to two numeric fields (X and Y). I want to have an X and a Y field in the form that automatically populate from NGR_to_XY. Whenever I join NGR_to_XY to the form's query it no longer allows editing of any fields in the form, although the X and Y fields are populated correctly.

 

How can I join the NGR_to_XY query and still be able to enter data into the form?

 

I did find this question but the solution uses VBA which I don't know how to use, is there a way that just uses regular design view? 

  • suggest to not Join query NGR_to_XY to your original query in your form.
    use DLookup() to retrieve the values from this query, therefore making your form updateable.
  • arnel_gp's avatar
    arnel_gp
    Steel Contributor
    suggest to not Join query NGR_to_XY to your original query in your form.
    use DLookup() to retrieve the values from this query, therefore making your form updateable.
    • cfarri's avatar
      cfarri
      Copper Contributor
      That's great, DLookup() works perfectly - thank you so much!
  • George_Hepworth's avatar
    George_Hepworth
    Silver Contributor
    Arnel's right. Don't even TRY to create editable queries from multiple underlying tables or queries unless you have very advanced SQL skills. The chances of such queries becoming non-editable grow quickly as more complexity is introduced.

Resources