Re: Filtering a form using a combo and 2 dates
From: prabha (nospam_at_microsoft.com)
Date: 03/02/04
- Next message: Duane Hookom: "Re: Creating automatic scheduling matrix - crosstab?"
- Previous message: Pete Davis: "Query questions"
- In reply to: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Next in thread: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Reply: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 02 Mar 2004 20:29:30 GMT
Hi Daniel,
It's not clear what you are attempting to do!!
When you do something like
DoCmd.OpenForm strForm, , , strSQL
you are saying open the Form with Records that match this string
Thereby, open my Form that is based on "XYZ table/query" but only return
the records that match this string.
What you are probably running into is:
- The Form is based on some other table than "RentalAgreement" that does
not have a field called "dateStart"
- Thereby you are prompted for parameter value.... it can't find the
field in the table/query
So it's like saying:
Return ALL the records from the table "XYZ" where the field in the table
"RentalAgreement" is between some values. Microsoft Access returns a
parameter value (question) how am I to match records in "XYZ" where the
value in "RentalAgreement" is between some value??
What you maybe looking to do is:
Create a SQL string that INNER JOIN "XYZ" with "RentalAgreement" along with
a Between Clause, example:
SELECT XYZ.*
FROM XYZ INNER JOIN RentalAgreement ON XYZ.RecordID =
RentalAgreement.RecordID
WHERE (((RentalAgreement.MyField) Between #1/1/2003# And #1/15/2003#));
Eric
--------------------
| From: fantast1cdan@hotmail.com (Daniel O'Neill)
| Newsgroups: microsoft.public.access.forms
| Subject: Re: Filtering a form using a combo and 2 dates
| Date: 2 Mar 2004 03:26:22 -0800
| Organization: http://groups.google.com
| Lines: 15
| Message-ID: <9c9c1055.0403020326.504c7072@posting.google.com>
| References: <9c9c1055.0403010948.388cd3d7@posting.google.com>
<jpfxjr#$DHA.4044@cpmsftngxa06.phx.gbl>
| NNTP-Posting-Host: 143.239.89.201
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1078226783 6878 127.0.0.1 (2 Mar 2004
11:26:23 GMT)
| X-Complaints-To: groups-abuse@google.com
| NNTP-Posting-Date: Tue, 2 Mar 2004 11:26:23 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXS01.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!
news.maxwell.syr.edu!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:257585
| X-Tomcat-NG: microsoft.public.access.forms
|
| Basically i am trying to compare a field called dateStart in another
| table called RentalAgreement to the values that the user enters into
| the two txt boxes on my filter form, i have modified the string to
| look like this.....
|
| strSQL = "[Outlet Number]= " & Me.lstOutlet & " And [dateStart]
| Between #" & Me.txtStart & "# and #" & Me.txtEnd & "#"
|
| The problem here seems to be the "dateStart" field, it doesnt seem to
| be able to link it to the RentalAgreement table, and instead asks for
| a parameter to be entered by the user,
| hope that explains it a little better,
| Thank you very much
| Regards
| Daniel
|
- Next message: Duane Hookom: "Re: Creating automatic scheduling matrix - crosstab?"
- Previous message: Pete Davis: "Query questions"
- In reply to: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Next in thread: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Reply: Daniel O'Neill: "Re: Filtering a form using a combo and 2 dates"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|