473,480 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting a label on a report after opening it

5 New Member
I am using MS Access 2010. I want to set a label on a report after opening it. I open the report with the following command, where sReport holds the report name:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport sReport, acViewPreview
I then check to make sure that the action didn't fail.

I then set the label with the following code:
Expand|Select|Wrap|Line Numbers
  1. Reports(msObject).xlblOption.Caption = Form_fFStMenus.xlblActiveMenu.Caption & nOption
The code does not give me an error, but neither does the xlblOption label have the desired value.

Any suggestions about what I am doing wrong?
Feb 9 '12 #1
4 4322
Mihail
759 Contributor
Manage that in Open event of the report itself.
Feb 9 '12 #2
NeoPa
32,556 Recognized Expert Moderator MVP
Very little information to work with here (You may want to consider better preparation of your question in future), but have you tried :
Expand|Select|Wrap|Line Numbers
  1. Reports(sReport).xlblOption.Caption = Form_fFStMenus.xlblActiveMenu.Caption & nOption
Feb 9 '12 #3
calogero
5 New Member
Thank you; that did the trick. But I couldn't just set the label directly to the value of the Form label. I got it to work by setting a public variable to the Form label and then setting the Report label to that public variable in the Report`s Open event
Feb 9 '12 #4
calogero
5 New Member
Sorry, my sample code left out the fact that msObject actually held the same value as sReport. It`s just that sReport is the parameter value in a subroutine I call to do the print preview and msObject is a private variable in a class that holds the commands to be executed.

Thanks for the suggestion though.
Feb 9 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
953
by: Jonas | last post by:
Hi! I'm trying to set the date format of some field objects in the report from ASP.NET. I would like to be able to set it with a string like "mm/dd/yyyy" depending on the language setting of the...
2
2540
by: Rick Caborn | last post by:
I am having a problem with an Access 2000 report getting data from SQL Server 2000. Here are the specifications for it: RecordSource: a stored procedure (tested via query analyzer and working...
3
3084
by: Andrea | last post by:
Hello, I am looking for the directions on how to set a report to print continuously, without a paper feed. I have set one up using the Label Wizard, but how do I set it up in an existing report? ...
3
4164
by: Roy | last post by:
Could someone please post some sample code on how to set an <asp:label> equal to the results of a sql query? This seems like it should be simple, but I can't seem to get it done.
12
1914
by: Beany | last post by:
hi, i have a form that has two buttons...................... one button opens a form with a combobox.............. this combobox has a list of usernames(from the table)........ When selecting a...
3
1782
by: John | last post by:
In my app I've created a label report (Avery 7162, 2 colums, 8 rows) with the wizzard. The report is based on a temp table that is created when the user pushes a button. After creation of the table...
3
2183
by: Apple001 | last post by:
I am having hard time finding the way to make the database below. I have: -Form "frmInvoice" with subform "Allocation" based on table "tblInvoice" and "tblAllocation". "invID" is auto number in...
1
1381
by: Elainie | last post by:
I have a form with 2 fields on it, one for directorate and the other for quarter's i.e. 1,2,3,4 if a certain directorate and quarter is selected go and get a certain report, that I have built...
2
11323
by: Neelesh2007 | last post by:
Hi all. I have Project in vb6.0. In my PC printer have default page letter. Now please tell me how can I set Report size of Data Report so that it doesn't show Error "Report width is larger than...
1
1870
dsatino
by: dsatino | last post by:
I have a report based on query that is built dynamically at runtime. Because of the dynamic nature of the SQL, the report is modified at runtime to adjust the group levels and create the proper field...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.