Hi Tom,
thanks for your reply. I've been looking into the example from your website
and I notived the RequerySubform() is quite important. However when I tried
to understand (and adapt) the VBA for this, I got lost.
Here is my situation (the field names might seem a bit strange, but I am
dutchspeaking, so):
main form: frmResultList
SELECT *
FROM qry_verkoper;
(* = id_verkoper and naam_verkoper)
subform: frmResultListDate (based on qryResultDate)
SELECT tbl_verkoper.ID_verkoper, tbl_verkoper.naam_verkoper,
tbl_klant.klant_nr, tbl_klant.klant_naam, tbl_klant.klant_plaats,
tbl_actie.[datum uitvoering], tbl_actie.resultaatId,
tblResultaat.resultaatOmschrijving, tbl_actie.resultaatTxt
FROM tbl_verkoper INNER JOIN (tbl_klant INNER JOIN (tblResultaat RIGHT JOIN
tbl_actie ON tblResultaat.resultaatID = tbl_actie.resultaatId) ON
tbl_klant.klant_nr = tbl_actie.idKlantnr) ON tbl_verkoper.ID_verkoper =
tbl_klant.id_verkoper
GROUP BY tbl_verkoper.ID_verkoper, tbl_verkoper.naam_verkoper,
tbl_klant.klant_nr, tbl_klant.klant_naam, tbl_klant.klant_plaats,
tbl_actie.[datum uitvoering], tbl_actie.resultaatId,
tblResultaat.resultaatOmschrijving, tbl_actie.resultaatTxt
HAVING (((tbl_actie.resultaatId)<>2 And (tbl_actie.resultaatId)<>0));
Main and subform are connected by id_verkoper and IDverkoper.
What I am trying to get at is to select a salesrep (verkoper) from the
combobox on the main form and then choose a start date and end date (for
which I have 2 text fields with date picker button) from the date picker to
have as a result the records for the salesrep during the chosen period.
Does this make sense for any help?
Kind regards,
Chris
"Tom Wickerath" <AOS168b AT comcast DOT net> schreef in bericht
news:6C0FE7A8-61B4-4EEE-AC7E-(E-Mail Removed)...
> Hi Chris,
>
> You didn't state whether your main form, "frmResultList", is a bound form
> (ie. includes a Record Source) or is an unbound form. I prefer designing
> search forms to find records using unbound forms. It is certainly possible
> to
> use Allen's calendar control with an unbound search form. Here is an
> example
> that you can download from my web site:
>
> http://www.accessmvp.com/TWickerath/.../Chap08QBF.zip
>
> I also have a tutorial on this technique, available here:
> http://www.seattleaccess.org/downloads.htm
>
> Look for this download:
> Query By Form - Multi Select
> Tom Wickerath, February 12, 2008
>
> The tutorial includes a Word document, and a cut-down version of the
> Northwind sample database. However, this sample does not currently include
> a
> date range search.
>
> If you are working with a bound form, then I suppose you would somehow
> need
> to use the dates in unbound text boxes, with the values applied to a form
> filter.
>
>
> Tom Wickerath
> Microsoft Access MVP
> http://www.accessmvp.com/TWickerath/
> http://www.access.qbuilt.com/html/ex...tributors.html
> __________________________________________
>
> "Chris" wrote:
>
>> Hi,
>>
>> I'd like to use Allan Browne's popup calendar on a form with a subform:
>> on the form frmResultList, I have a combobox cboSalesRep. When selecting
>> a
>> name here I get in a subform subfrmResultList the result of a query
>> showing
>> the sales results of that salesrep.
>> Is it possible to use Allan Browne's popup calendar to enter a start and
>> end
>> date of a period showing the results of the salesrep during that period?
>> I
>> can get the result by putting a Between-statement in the criteriabox of
>> the
>> query, but I'd prefer using the popup calendar.
>>
>> Thanks for your help.
>> Chris