I am creating an Acquisition Management System for a Library in LibreBase (v7.5.4), thus far, I am at the following: A table called BooksDB containing the fields
- Accession No (NUMERIC type) (also Primary Key)
- Title(VARCHAR type)
- Other information, etc.
Another table called AcqSys containing the fields
- Acq ID (Primary Key)
- Acquisition Date
- Acquired From
- Order Amount
- Other information, etc.
Another table called AcqEnt containing the fields
- AcqUEID (Primary Key)
- Accession No (NUMERIC type)
- Title (VARCHAR type)
- Book Cost
- Acq ID
- Other information, etc.
The Form frmAcqSys is made of two tables (Main Form = AcqSys, and Sub Form = AcqEnt, relationship linked via Acq ID, with the view that one AcqID shall contain various AcqEntries)
Now, based on Accession No entered in AcqEnt subform, I want the AcqEnt.Title to auto-populated/fetch data from BooksDB table for the corresponding Title in BooksDB for the same Accession No (AcqEnt.Title to fetch BooksDB.Title based on AcqEnt.Acession No = BooksDB.Accession No).
I have been unable to change data type to SQL in a text field, so I am using a ListBox for AcqEnt.Title in subform AcqEnt, and using the following SQL:
SELECT "Title", "Title" FROM "tblBDB" WHERE "Accession No" = "AcqEnt.Accession No"
or
SELECT "Title", "Title" FROM "tblBDB" WHERE "Accession No" = 'AcqEnt.Accession No'
They are returning the following error:
SQL Status: S0022
Error code: -28
Column not found: AcqEnt.Accession No in statement [SELECT "Title", "Title" FROM "tblBDB" WHERE "Accession No" = "AcqEnt.Accession No"]
How do I do it? Is there a better/more efficient way to achieve the output?