I have created a report in design mode. However, some of the fields i need are dynamic. That is, i have a series of fields text boxes mostly that must show up only as needed. I also have some labels that also should dynamic depending on the text boxes. I first tried createReportcon trol during the OnOpen event for the report,and when i tried to run it, it would give me an error 2147, that i must be in design view in order to create or delete controls. Someone in google said that one way to avoid this would be to make the call to CreateReportCon trol from another form, before calling the docmd.open report command. I tried that and i got another error, 2451, that i cannot create a control on an unopened report. Then someone in google was saying that's not a good idea anyway. And instead to create enough controls and just making visible as i need them. I can do that, however, i still need to have the labels created dynamically because the labels refer to types of text boxes and i need to present them as i need them. Is there a way to create label controls on the fly for a report? And is there another call besides createreportcon trol or createcontrol that i can use?
5 7781
Thanks. I will look at those posts.
I am trying this:
for each c in me.controls
if typeOf C is textbox then
me.controls(c.t ag).visible = true
me.controls(c.t ag).setfocus //it crashes
Me.lblMoneyOrde r.top = me.txppay1.top
endif
next
I get the run-time error 2478 indicating that the application does not allow you to use this method in the current view.
I am trying to load data to the text boxes based on some criteria. I wanted to create the textboxes on the fly but i kept getting errors such as 2147 that does not allow me to create a control on a report unless it is a design view.
How can i set the focus on a report control on the fly?
I am trying this:
for each c in me.controls
if typeOf C is textbox then
me.controls(c.t ag).visible = true
me.controls(c.t ag).setfocus //it crashes
Me.lblMoneyOrde r.top = me.txppay1.top
endif
next
How can i set the focus on a report control on the fly?
Trying this code WHERE?
To my knowledge, you cannot set focus to a control in a report, no matter what view it's in, nor can you use SetFocus in Design View on a form.
I get the run-time error 2478 indicating that the application does not allow you to use this method in the current view.
I am trying to load data to the text boxes based on some criteria. I wanted to create the textboxes on the fly but i kept getting errors such as 2147 that does not allow me to create a control on a report unless it is a design view.
You cannot create controls in Access, whether on a form or on a report, unless that form or report is opened in Design View! This is not going to change, no matter how mant times you try to do it.
To be honest, I think the best piece of advice you've gotten was from the person who told you that this wasn't a good idea. I personally consider it to be a horrendously bad idea. Trying to design and balance a report so that it presents data in a clear and professional manner is hard enough with the Design View in front of you. Trying to do it "on the fly" is really inane. You really need to think about designing your form in advance and, as has been suggested both here and elsewhere, making controls visible/invisible depending on your needs.
Welcome to Bytes!
Linq ;0)>
Well, Right you are. I finally realized that and have now just created a bunch of controls i need and just turn them on and off (visible) as i wish. I found a solution in this site for my problem of moving the labels to the required positions on the fly. But what i was hoping to do was to create a variable but limited number of text boxes depending on the requirements. Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Chris Curtis |
last post by:
We have a program which is used to upload data to our website.
A report file is saved each time and is supposed to reflect the date!
Not being a java programmer I think the following code is used to create the
report name.
try { copy("C:\\MDSPROXY\\REPORT\\eventLog.txt", "C:\\MDSPROXY\\REPORT\\"+
new java.util.Date().getYear() + new java.util.Date().getMonth() + new
java.util.Date().getDay() + new java.util.Date().getHours() + new...
|
by: nader |
last post by:
hello
what is the code to creating text compose many cells almost like excel
program to
or how do that
and thankyou for all :?:
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
|
by: Dylan |
last post by:
I need to create some runtime controls in a TabControl
I've tried doing the following but no controls appear
txtBox = New TextBo
tabCtrl.TabPages.Item(2).Controls.Add(txtBox) ' 2 being the index of the page I want to add the contro
txtBox.Left = 10
txtBox.Right = 10
txtBox.Visible = Tru
txtBox.Enabled = Tru
|
by: Barrett |
last post by:
Hello,
basically I want to be able to determine the height of a panel at runtime on
a webform. The only value I can squeeze out of the control properties is the
height that is set at design time. I know the height differs because
controls within the panel are dynamic thus affecting the visible height of
it.
Thanks
|
by: Andrea |
last post by:
I'm having some difficulty creating a report in Access and I need some
suggestions. My company issues "Return Authorizations" when customers
need to return products. A customer calls in and we provide the
number. The customer then returns items for a refund or for an
exchange. Here is the basic set up of the tables in question.
-ReturnAuthorizationTable-
ReturnNumber_PK
CustomerID
ReturnType
| |
by: rp |
last post by:
Hi,
How would I create runtime tabpages with runtime
controls(textBoxes,comboBox, checkedListBox), inserting,deleting, and
modifing the tabpages whenever I want to in C#? Thanks in advance.
rp
|
by: Steve |
last post by:
This is a weird one.
I have a series of "SmartParts" which are CAB (Composite Application Block)
Views which are finally just UserControls (99% of the time)
Anyway, I layout my UserControl in the VS2005 designer, but at runtime, the
controls are in different locations and different sizes. I have been able
to restore their sizes by putting a hack together that will set their sizes
to the correct values in the UserControl's Resize...
|
by: BurntWithTime |
last post by:
Hello everyone,
Please can anyone tell me if it is possible for a VB.NET application to
check a database and then create textboxes on a form that correspond to
those records on the database? For example, say I had a table in a DB that
contained movie subjects: Horror, Sci-Fi, Comedy etc. Would it be possile
for the VB app to look at these and then create the text boxes Horror,
Sci-Fi and Comedy?
Thanks,
BWT
|
by: BobLewiston |
last post by:
Can anybody tell me how to change WinForm controls' text color programatically? I have no problem finding the fields to assign colors to, but the compiler doesn't recognize any color I mention, whether it's something like WindowText, or something like Red.
BTW, I'm using VC# Express 2008.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |