Re: problem with form...
- From: "LouisPat" <LouisPat@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 08:26:13 -0700
Thanks... this should work.
But I have a problem getting my code right in the DoCmd.OpenReport in the
WhereCondition
in the queries that I did, the criteria was I used
WHERE ((([intervention hydrant].[Date interv])=(SELECT MAX (tmp.[Date
interv]) FROM [intervention hydrant] as tmp WHERE tmp.[hydrant id] =
[intervention hydrant].[hydrant id])) AND (([intervention
hydrant].[Functional])=True));
for the case where I'd like to get the functional hydrant at the latest date
of intervention
how do I write this in the DoCmd.OpenReport?
Thanks again!
"Nikos Yannacopoulos" wrote:
> If i get this right, the fields are always the same, and what changes is
> the filters? If yes, you only need one report, and one query, or no
> (saved) query at all. Set the report's recordsource to your table or
> single saved query, and in the code behinf the command button on the
> form which opens the report, construct a Where statement, based on the
> user's selections on the form; then use this string in the
> WhereCondition argument in the DoCmd.OpenReport.
>
> On your other question, Also, put this code in the report's On No Data
> event:
>
> msg = "No data exists for the chosen criteria."
> typ = vbExclamation
> ttl = "Report cannot be generated"
> MsgBox msg, typ, ttl
> Cancel = True
>
> This will produce a message for the user and cancel opening the report,
> if there is no data.
>
> HTH,
> Nikos
>
.
- Follow-Ups:
- Re: problem with form...
- From: Nikos Yannacopoulos
- Re: problem with form...
- References:
- problem with form...
- From: LouisPat
- Re: problem with form...
- From: Nikos Yannacopoulos
- problem with form...
- Prev by Date: Re: Creating a Form for a Touch Screen Monitor
- Next by Date: Re: Text Boxes
- Previous by thread: Re: problem with form...
- Next by thread: Re: problem with form...
- Index(es):
Relevant Pages
|