antonyx
Arsenal Supporter
- Local time
- Today, 21:14
- Joined
- Jan 7, 2005
- Messages
- 556
Code:
SELECT tblInvoice.InvoiceRef, tblInvoice.Status FROM tblInvoice WHERE tblInvoice.InvoiceRef (first three letters) = (tblAccount.Accountref Where tblAccount.AccountID = cboAccount);
InvoiceRef and AccountRef are both text datatypes
here are sample records from the 2 tables concerned:
tblInvoice
InvoiceRef (MCD98978)
Status (Paid)
tblAccount
AccountID (Autonumber) (1)
AccountName (McDonalds)
AccountRef (MCD)
On my form
I want this query to select the:
InvoiceRef & Status fields from tblInvoice
Where the first three letters of tblInvoice.InvoiceRef..
match the first three letters of the tblAccount.AccountRef
The account ref is derived from a drop down called 'cboAccount'..
However.. at the moment the AccountRef is not actually in the drop down.. the only values selected in that drop down are the AccountID and the AccountName
that is why i have tried something like this..
Code:
SELECT tblInvoice.InvoiceRef, tblInvoice.Status FROM tblInvoice WHERE tblInvoice.InvoiceRef (first three letters) = (tblAccount.Accountref Where tblAccount.AccountID = cboAccount);
Last edited: