Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Re: set text bo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 30244 of 31298
Post > Topic >>

Re: set text box value in page header via vb

by fredg <fgutkind@[EMAIL PROTECTED] > May 12, 2008 at 08:23 PM

On Tue, 13 May 2008 02:17:04 +0000 (UTC), Analysis&Solutions wrote:

> Hi:
> 
> I'm using the following Visual Basic code to open a re****t and set the 
> value of an unbound text box in its page header.  It works... but only
on 
> pages other than the first one.
> 
>    DoCmd.OpenRe****t strRe****tName, acViewPreview, , strWhere
>    Re****ts(strRe****tName)("SearchCriteriaBox").Value = strWhere
> 
> How can I get it to work on the first page too, please?  There are
other, 
> regular text boxes in the page header that contain regular 
> Control Sources in them, like =Now(), that are working fine.  The 
> re****t's Page Header setting is "All Pages," as it should be.
> 
> Thanks,
> 
> --Dan

There are several ways to do this.
Here is one.

On the form, open the re****t, set the criteria, and pass the criteria
to the re****t as the OpenArgs argument.

DoCmd.OpenRe****t strRe****tName, acViewPreview, , strWhere, , strWhere

In the re****t, assign the OpenArgs to the Page Header unbound control
in the Re****t's Re****t Header Format event (the Open event is too
early). 
Code the re****t's Re****tHeader format event:

Me.[SearchCriteriaBox] = Me.OpenArgs

This will display your strWhere clause in the re****t page header, i.e. 
[LastName] = 'Jones'

Is that what you want?
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




 6 Posts in Topic:
set text box value in page header via vb
info@[EMAIL PROTECTED] (  2008-05-13 02:17:04 
Re: set text box value in page header via vb
lyle fairfield <lyle.f  2008-05-12 20:00:20 
Re: set text box value in page header via vb
info@[EMAIL PROTECTED] (  2008-05-13 19:11:43 
Re: set text box value in page header via vb
fredg <fgutkind@[EMAIL  2008-05-12 20:23:51 
Re: set text box value in page header via vb
info@[EMAIL PROTECTED] (  2008-05-13 19:06:26 
Re: set text box value in page header via vb
CDMAPoster@[EMAIL PROTECT  2008-05-15 17:38:09 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Oct 11 8:44:55 CDT 2008.