473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to assign values to Unbound Text box in Report thru VBA code ?

I have a report with some Unbound text boxes. I want to shows the values in
these text boxes from my VBA code. How can I assign the valuse thru code ?
Pls help me.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
7 21908
rkc
Paul via AccessMonster.com wrote:
I have a report with some Unbound text boxes. I want to shows the values in
these text boxes from my VBA code. How can I assign the valuse thru code ?
Pls help me.


Assign values to the textbox controls in the report's
Detail_Format event.
Nov 13 '05 #2
Create a Public Function that returns the string you want to appear in
the text box.

eg.
Public Function MyFunction() As String
MyFunction="The Iraq War is illegal and immoral."
End Function

Set the ControlSource of the TextBox to
=MyFunction()

Nov 13 '05 #3
rkc
ly******@yahoo.ca wrote:
Public Function MyFunction() As String
MyFunction="The Iraq War is illegal and immoral."
End Function


I get a compiler error when I try this.
Nov 13 '05 #4
I don't know what to say. I have been using this kind of assignment for
a long time, back to Access 95. At that time I had an extensive charity
receipt/thanks writing report which selected text depending on type of
membership, type of donation etc.

I just double checked in Access 2002 and up pops:

The Iraq War is illegal and immoral.

Could it be God speaking, and not the report at all?

Nov 13 '05 #5
ly******@yahoo.ca wrote:
: Create a Public Function that returns the string you want to appear in
: the text box.

: eg.
: Public Function MyFunction() As String
: MyFunction="The Iraq War is illegal and immoral."
: End Function

: Set the ControlSource of the TextBox to
: =MyFunction()

How do you adapt this for the array needed by a combobox?
thanks, --thelma
Nov 13 '05 #6
rkc
ly******@yahoo.ca wrote:
I don't know what to say.


It was comedy my friend from the north.
Nov 13 '05 #7
A Combo Box's value should be able to be set just like a that of a
TextBox.

For my preferred way to set a ComboBox's list in code see
http://groups.google.ca/group/comp.d...d80edcea8a1598
and the two immediate children of that post.
Other developers will have other preferred ways.

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jayjay | last post by:
I've got a report that has a series of unbound text boxes that are being populated by some variables in code. The format is supposed to be a currancy format, but on a certain series of boxes, I...
4
by: N. Graves | last post by:
Hello, Please help me I'm still a newbie. I have an unbound text box on a report that I would like to build a expression to display it on the report. Something like txtboxSearchCriteria = !!...
6
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text =...
5
by: Eric | last post by:
I try to to set the value of a text box through code and it will always display the same value in every record. I think i cant display a recordset in a text box. What way i use so that i can...
1
by: Patonar | last post by:
Hi, I have a report that is calculating subtotals - however sometimes there is no data to show.... so the subtotal field will be blank. Is there anyway that if this happens i can set the default...
5
by: jamesnkk | last post by:
I have an unbound text - txtfreight on a Subform, when I enter a value , it does not save to the Main form table immediately, unless I close and open up the form. How can I force to save immediately...
1
by: AccessHunter | last post by:
Hi, I have an access report whose control source is a table. The report is opened via vba code.There is also an unbound text box (named - PassedonParms) on the report. In the vba code I have a...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
2
topher23
by: topher23 | last post by:
Disclaimer: I've already come up with a solution for this issue, but I thought I'd post it in the hope that it could help someone else and on the off chance that someone has another solution. I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
agi2029
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,...

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.