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"
Is that right? Or do i not even need to create a query? Im sorry im really
new to writing applications in Access. I really appreciate the help
you’ve
given me thus far.
"Albert D. Kallal" wrote:
> "Bonz099" <Bonz099@[EMAIL PROTECTED]
> wrote in message
> news:44EF7C0F-0A9F-4236-A334-66DE3D3AA589@[EMAIL PROTECTED]
> > Idealy I would want to build a re****t that would allow me to pass the
> > "datesubmitted" to the query for it. But it have no idea where to
paste
> > this
> > code or how to structure the dynamic query.
> >
> > Would you mind explaining where to put the code and how my query that
the
> > form references should look like?
>
> ok...
>
> Lets assume you want to send the results to a re****t.
>
> The user could then
> print, or close the re****t when done.
>
> The 1st thing is to build a re****t based on that table. Set all of the
> sorting and grouping stuff in the re****t. Get it exactly the way you
want.
>
> Note that the re****t will have no parameters and there is little
advantage
> to
> base the re****t on a query. Once that re****ts looks the way you want,
then
> close it and save it.
>
> Ok...now that our re****t is good, we go back to your continues form, and
the
> code behind the button will be:
>
> dim strWhere as string
> strWhere = "DateSubmited = #" & format(me!DatesSubmitted,"mm/dd/yyyy") &
"#"
> docmd.Openform "MyRe****t",acViewPreview,,,strwhere
>
> So, the code goes behind that button on the continues form you talked
> about...
>
> I have assumed that the date on that row when clicked is
me!DatesSubmitted
> (I you have to change that to the name of the actual date field you used
> (can't read minds!!!).
>
> If you allow editing of data in the continues form, then you need to
force a
> disk write BEFORE you launch the re****t. Change above to:
>
> dim strWhere as string
> strWhere = "DateSubmited = #" & format(me!DatesSubmitted,"mm/dd/yyyy") &
"#"
> me.refresh
> docmd.Openform "MyRe****t",acViewPreview,,,strwhere
>
> So, it is assumed that the above code goes behind the button your
pressing.
> We thus do not have to build a new query for the re****t..but only pass
it
> the "where" clause to restrict it to whatever we want -- in this case
the
> one date.....
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@[EMAIL PROTECTED]
>
>
>
>


|