Help with WHERE

J

Janet

Hi,
I'm using the query shown below in a subform in Form1 and works fine.
However, I would like to put in place of 1725 a field from Form1 so that
when inserting a BookNo in it, a list would be shown in the subform. I tried
with
WHERE (((BookNo)=[Forms]![frmForm1]![fieldx]))
but no dice.
Can someone help?
TIA

SELECT TOP 100 PERCENT BookNo, DateService, InvoiceNo, Kilometres,
Service
FROM tblServices
WHERE (BookNo = 1725)
ORDER BY DateService
 
V

Van T. Dinh

Perhaps, a more efficient method is to link the SubForm to
the Main Form using the LinkMasterFields and
LinkChildFields (assuming you are using bound Form / bound
Subform). This way, Access automatically requeries the
Subform for you.

With the WHERE Clause you need to instruct Access to re-
query the Subform at appropriate time.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top