Talk About Network

Google





Software > Access Forms > Re: Dynamic Que...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 44666 of 46786
Post > Topic >>

Re: Dynamic Query Based on Current Row

by "Albert D. Kallal" <PleaseNOOOsPAMmkallal@[EMAIL PROTECTED] > Aug 11, 2008 at 01:32 AM

"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]

 




 7 Posts in Topic:
Dynamic Query Based on Current Row
=?Utf-8?B?Qm9uejA5OQ==?=   2008-08-07 21:11:01 
Re: Dynamic Query Based on Current Row
"Albert D. Kallal&qu  2008-08-07 22:48:26 
Re: Dynamic Query Based on Current Row
=?Utf-8?B?Qm9uejA5OQ==?=   2008-08-08 09:05:01 
Re: Dynamic Query Based on Current Row
"Albert D. Kallal&qu  2008-08-08 18:11:37 
Re: Dynamic Query Based on Current Row
=?Utf-8?B?Qm9uejA5OQ==?=   2008-08-09 17:55:01 
Re: Dynamic Query Based on Current Row
"Albert D. Kallal&qu  2008-08-11 01:32:38 
Re: Dynamic Query Based on Current Row
Piet Linden <PieterLin  2008-08-09 20:49:31 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 16:56:11 PST 2009.