PC Review


Reply
Thread Tools Rate Thread

calling a report from a form

 
 
Frank
Guest
Posts: n/a
 
      3rd Jul 2004
Hi,

I have a search from where it calls a report. Depending on the search word
it filters the records in the report. How can I pass the value of the text
box to the OpenReport command. Here are the lines I am trying to run:
strToSearch = txtSearch.Value
strWhereClause = "(((StrComp(Left(Products.ProductName,Len([" &
strToSearch & "])),[" & strToSearch & "]))=0))"
DoCmd.OpenReport "Generic Name Search Report", acViewPreview, ,
strWhereClause
Thank you.

Frank


 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      3rd Jul 2004
Get rid of the square brackets []. They're only required when you want to
put the name of a field inside, not a literal value.


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Frank" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a search from where it calls a report. Depending on the search word
> it filters the records in the report. How can I pass the value of the text
> box to the OpenReport command. Here are the lines I am trying to run:
> strToSearch = txtSearch.Value
> strWhereClause = "(((StrComp(Left(Products.ProductName,Len([" &
> strToSearch & "])),[" & strToSearch & "]))=0))"
> DoCmd.OpenReport "Generic Name Search Report", acViewPreview, ,
> strWhereClause
> Thank you.
>
> Frank
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Form from Report =?Utf-8?B?S291IFZhbmc=?= Microsoft Access VBA Modules 3 2nd Aug 2007 07:25 PM
Calling report from form that uses Dlookup =?Utf-8?B?TGluZGE=?= Microsoft Access Reports 3 16th May 2007 11:41 PM
Re: Calling a report from popup form =?Utf-8?B?Q2hyaXM=?= Microsoft Access Forms 2 19th Sep 2005 04:40 PM
Calling a form on report close action. NEMO2K Microsoft Access Reports 4 5th Oct 2004 08:13 AM
Calling Filtered report from cmdbutton on form Dale C Gray Microsoft Access Reports 2 24th Sep 2003 01:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.