Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Report Query??

0 views
Skip to first unread message

Ron Taylor

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to
I have created a form that I can look up and edit records.  I created a push button command that will execute a report preview.  Everything is working as expected except that when I push the Report Preview button I get all records instead of the one on the screen.  This is the problem.  How do I modify the properties for the 'cmdReport Preview' command button so that I only get the record currently shown in the form?  The key field for the table is 'CTRL#'.  The name of the report is 'Lease Detail'
 

Dev Ashish

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to

Hi,

Use the OpenReport's Where condition to specify your record. For example,
the following code placed behind a command button on the form would use the
RunID control on the form to restrict the Report to only one record.

'******************** Code Start ************************
Dim strDocName As String
Dim strWhere As String
strDocName = "Lease Details"
strWhere = "[CTRL#]=" & me!CTRL#
DoCmd.OpenReport strDocName, acPreview, , strWhere
'******************** Code End ************************

HTH
--
Just my $.001
Dev Ashish
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

Ron Taylor wrote in message <6cpoqm$c...@bgtnsc02.worldnet.att.net>...

Keri Hardwick

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to

Ron,

Add a condition on the OpenReport method. For example,
DoCmd.OpenReport "Lease Detail", acPreview,,"[CTRL#] = '" & me![CTRL#]
&"'"

That statement will need modifying if the CTRL# field on the report is
not named CTRL#, or if it is not text. See OpenReport in help if you
want more details.

Keri Hardwick

Joe We are Borg Foster

unread,
Feb 22, 1998, 3:00:00 AM2/22/98
to

In article <6cpoqm$c...@bgtnsc02.worldnet.att.net>, ront...@worldnet.att.net (Ron Taylor) writes:

> I have created a form that I can look up and edit records. I created a =
> push button command that will execute a report preview. Everything is =
> working as expected except that when I push the Report Preview button I =
> get all records instead of the one on the screen. This is the problem. =
> How do I modify the properties for the 'cmdReport Preview' command =
> button so that I only get the record currently shown in the form? The =
> key field for the table is 'CTRL#'. The name of the report is 'Lease =
> Detail'

Use DoCmd.OpenReport with a where condition?

> Ron Taylor

> ------=_NextPart_000_0010_01BD3F90.F57B9740
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">

Aaargh! Don't post HTML to Usenet! The typical auto-generated HTML
is as bloated as the Word docs and MDBs certain idjits post here!

--
Joe Foster <mailto:jfo...@ricochet.net> Spam is irrelevant. Assimilate this:
<ftp://ftp.microsoft.com/softlib/index.txt> Microsoft's master patch list
<ftp://ftp.microsoft.com/softlib/mslfiles/> MS I got yer patch right here!
<http://www.microsoft.com/msdn/> MS Knowledge Base & more
<http://www.dejanews.com/home_ps.shtml> Usenet search and archival engine
<http://www.altavista.digital.com> WWW *and* Usenet search engine
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!

0 new messages