Re: Filtering a form using a combo and 2 dates

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: prabha (nospam_at_microsoft.com)
Date: 03/02/04


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
|



Relevant Pages

  • Re: Read strings from one file and search for them in a directory containing htm files
    ... > XyZ technology helps make home networking simple. ... Now we're back to about my original suggestion, if there's no newlines ... while IFS= read -r string ...
    (comp.unix.shell)
  • Re: Help with shell script
    ... for the string 'abc', and puts the matching lineinto the variable xyz. ... in xyz to awk. ... ..which will print the second column from the /etc/passwd delimited by ':'s. ...
    (comp.unix.shell)
  • Re: String To List
    ... list with elements 'xyz' and 'abc'. ... could the string module not use a ... string enclosed by delim (or which begin with delim and end with ... (odd number of delimiters, or opening/closing delims ...
    (comp.lang.python)
  • Re: Filtering a form using a combo and 2 dates
    ... > Hi Daniel, ... > the records that match this string. ... > FROM XYZ INNER JOIN RentalAgreement ON XYZ.RecordID = ... > | table called RentalAgreement to the values that the user enters into ...
    (microsoft.public.access.forms)
  • Re: How to extract a string starting with abc & ending with xyz ?
    ... But if the length of the string varies between 10 to 50* what ... You are only comparing the string with "abc xyz". ... The automatic assumption that all programs should write error messages ...
    (comp.lang.c)