Help with WHERE

  • Thread starter Thread starter Janet
  • Start date Start date
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
 
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)
 
Back
Top