"Bonz099" <Bonz099@[EMAIL PROTECTED]
> wrote in message
news:CEB53C97-168B-4A35-8342-80F3BB222058@[EMAIL PROTECTED]
> Ok so let me see if I have this right, for the on click for the button I
> use
> this:
>
> dim strWhere as string
> strWhere = "DateSubmited = #" & format(me!DatesSubmitted,"mm/dd/yyyy") &
> "#"
> docmd.Openform "MyRe****t",acViewPreview,,,strwhere
>
> So that particular code opens a form called "MyRe****t" and that form is
> linked to query. And my Query should looks like "SELCT * FROM Table
WHERE
> DateSubmitted = strwhere"
No, you don't need any link or anything speicak in the re****t. The re****t
will be based on the table, and that is all.
The OpenReprot command (above for some reason we have flipped into talking
about a form..but I assumed it was a re****t). The process is the same for
both cases.
So, the above command is not going to open a form (but, it could), it is
going to open a re****t...
eg:
dim strWhere as string
strWhere = "DateSubmited = #" & format(me!DatesSubmitted,"mm/dd/yyyy") &
"#"
docmd.Re****t "MyRe****t",acViewPreview,,strwhere
Note above how the number of "," been corrected....
Note however, often we have a continuous form, and we do open up a form to
view "more" details. The above code to open a form would be:
dim strWhere as string
strWhere = "DateSubmited = #" & format(me!DatesSubmitted,"mm/dd/yyyy") &
"#"
docmd.OpenForm "MyFormName",,,strwhere
So you can open a form, or re****t using this approach. There is not a
special query or connection..the "where" clause simply restricts the
records
that the re****t will show.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@[EMAIL PROTECTED]


|