473,406 Members | 2,259 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,406 software developers and data experts.

populating an unbound field in a continuous record form

I have a form that displays record information in Continuous Record
display (scrollable list). One of the fields in the record is an
Integer value called "rcode" (reason code). But, I don't want to
display the reason code integer value. I want to display the reason
code descriptive text (string data). So I have a TEXT BOX object on the
form to display the text.

I have an public array defined(global variable defined in CommonProcs
module) that has the "rcode" values and the "rtext" values. It is
populated when the application first is launched and is available by the
time this form is opened.

The intent is that I should be able to use the "rcode" from the record
as an index into the array and find the "reason code text".

THE BACKGROUND:
When the form loads I do the following (in the Form_Open( ) routine):

Me!reasoncd = IIf(Me!rcode = 0, " ", aryReasonCodes(Me!rcode).strRText)

where me!reasoncd is the text box on the form.

THE PROBLEM:
EVERY record displays the SAME TEXT, regardless of the actual [rcode]
value in the record.

The array is definitely populated so that we should be able to get the
correct text provided we have the correct index value. The records have
the correct [rcode] values, as well.

Do you have a solution to my problem?

Thanks.
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Mar 5 '08 #1
4 5498
First of all, I would suggest you place the reasoncd and description
into a Table. That will make things easier and its easier to modify if
necesary. So you have a table tblReasonCodeDesc that looks like this:

Reasoncd ReasonDesc
1 Outbound
2 Inbound
3 Failed

Then in your form RecordSource type in the query with the union. Click
on the "..." to open the query builder. And and join your table with
tblReasonCodeDesc on reasoncd = ReasonCD.

Then just bound that text field with ReasonDesc.

- GL

On Mar 5, 4:01*pm, Susan Bricker <slbr...@verizon.netwrote:
I have a form that displays record information in Continuous Record
display (scrollable list). *One of the fields in the record is an
Integer value called "rcode" (reason code). *But, I don't want to
display the reason code integer value. *I want to display the reason
code descriptive text (string data). *So I have a TEXT BOX object on the
form to display the text.

I have an public array defined(global variable defined in CommonProcs
module) that has the "rcode" values and the "rtext" values. *It is
populated when the application first is launched and is available by the
time this form is opened.

The intent is that I should be able to use the "rcode" from the record
as an index into the array and find the "reason code text".

THE BACKGROUND:
When the form loads I do the following (in the Form_Open( ) routine):

Me!reasoncd = IIf(Me!rcode = 0, " ", aryReasonCodes(Me!rcode).strRText)

where me!reasoncd is the text box on the form.

THE PROBLEM:
EVERY record displays the SAME TEXT, regardless of the actual [rcode]
value in the record. *

The array is definitely populated so that we should be able to get the
correct text provided we have the correct index value. *The records have
the correct [rcode] values, as well.

Do you have a solution to my problem?

Thanks.
Regards,
SueB

*** Sent via Developersdexhttp://www.developersdex.com***
Mar 5 '08 #2

"Susan Bricker" <sl*****@verizon.netschreef in bericht news:12***********@news.newsfeeds.com...
>I have a form that displays record information in Continuous Record
display (scrollable list). One of the fields in the record is an
Integer value called "rcode" (reason code). But, I don't want to
display the reason code integer value. I want to display the reason
code descriptive text (string data). So I have a TEXT BOX object on the
form to display the text.

I have an public array defined(global variable defined in CommonProcs
module) that has the "rcode" values and the "rtext" values. It is
populated when the application first is launched and is available by the
time this form is opened.

The intent is that I should be able to use the "rcode" from the record
as an index into the array and find the "reason code text".

THE BACKGROUND:
When the form loads I do the following (in the Form_Open( ) routine):

Me!reasoncd = IIf(Me!rcode = 0, " ", aryReasonCodes(Me!rcode).strRText)

where me!reasoncd is the text box on the form.

THE PROBLEM:
EVERY record displays the SAME TEXT, regardless of the actual [rcode]
value in the record.

The array is definitely populated so that we should be able to get the
correct text provided we have the correct index value. The records have
the correct [rcode] values, as well.

Do you have a solution to my problem?

Thanks.
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
I guess because the field is *unbound* as you say, the value will be the same indeed for all the records ...

Simply change your query and link your rcode to a table with the textvalues for the rcodes ??
Or use the array, BUT use the array in the query that 'feeds' the form
Or am I missing something ??

Arno R
Mar 5 '08 #3
Simply change the query and link yout rcode to a table with the
textvalues for the rcodes!! Yes that's it. Don't use the array
anymore.

The reason the unbound field repeats the value is that Me!reasoncd
refers to the current record only so when you open the form the
current record is 1 so Me!reasoncd will be the same for all the
records after that.

- GL
On Mar 5, 4:32*pm, "Arno R" <arracomn_o_s_p_...@planet.nlwrote:
"Susan Bricker" <slbr...@verizon.netschreef in berichtnews:12***********@news.newsfeeds.com...


I have a form that displays record information in Continuous Record
display (scrollable list). *One of the fields in the record is an
Integer value called "rcode" (reason code). *But, I don't want to
display the reason code integer value. *I want to display the reason
code descriptive text (string data). *So I have a TEXT BOX object on the
form to display the text.
I have an public array defined(global variable defined in CommonProcs
module) that has the "rcode" values and the "rtext" values. *It is
populated when the application first is launched and is available by the
time this form is opened.
The intent is that I should be able to use the "rcode" from the record
as an index into the array and find the "reason code text".
THE BACKGROUND:
When the form loads I do the following (in the Form_Open( ) routine):
Me!reasoncd = IIf(Me!rcode = 0, " ", aryReasonCodes(Me!rcode).strRText)
where me!reasoncd is the text box on the form.
THE PROBLEM:
EVERY record displays the SAME TEXT, regardless of the actual [rcode]
value in the record. *
The array is definitely populated so that we should be able to get the
correct text provided we have the correct index value. *The records have
the correct [rcode] values, as well.
Do you have a solution to my problem?
Thanks.
Regards,
SueB
*** Sent via Developersdexhttp://www.developersdex.com***

I guess because the field is *unbound* as you say, the value will be the same indeed for all the records ...

Simply change your query and link your rcode to a table with the textvalues for the rcodes ??
Or use the array, BUT use the array in the query that 'feeds' the form
Or am I missing something ??

Arno R- Hide quoted text -

- Show quoted text -
Mar 5 '08 #4
On Wed, 05 Mar 2008 14:01:34 -0600, Susan Bricker <sl*****@verizon.netwrote:
>I have a form that displays record information in Continuous Record
display (scrollable list). One of the fields in the record is an
Integer value called "rcode" (reason code). But, I don't want to
display the reason code integer value. I want to display the reason
code descriptive text (string data). So I have a TEXT BOX object on the
form to display the text.

I have an public array defined(global variable defined in CommonProcs
module) that has the "rcode" values and the "rtext" values. It is
populated when the application first is launched and is available by the
time this form is opened.

The intent is that I should be able to use the "rcode" from the record
as an index into the array and find the "reason code text".

THE BACKGROUND:
When the form loads I do the following (in the Form_Open( ) routine):

Me!reasoncd = IIf(Me!rcode = 0, " ", aryReasonCodes(Me!rcode).strRText)

where me!reasoncd is the text box on the form.

THE PROBLEM:
EVERY record displays the SAME TEXT, regardless of the actual [rcode]
value in the record.

The array is definitely populated so that we should be able to get the
correct text provided we have the correct index value. The records have
the correct [rcode] values, as well.

Do you have a solution to my problem?

Thanks.
Regards,
SueB
You need to write a function which uses [rcode] as a parameter to return the
correct value from the array for each record.
Then set the control source of reasoncd to =MyFunction([rcode])
Function MyFunction(intRCode as integer) As Variant

If intRCode=0 Then
MyFunction = Null
Else
MyFunction = aryReasonCodes(Me!rcode).strRText
End If

End Function

Wayne Gillespie
Gosford NSW Australia
Mar 5 '08 #5

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

Similar topics

3
by: Pat | last post by:
Hello, I've used Sum() to total bound fields on a continuous form with no problem. However, I now have a continuous form, on which I use an unbound field to calculate the number of hours between...
2
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS...
4
by: Pierre | last post by:
Hi all, To ease load on a network i close automatically form open with a timer reset by user actions. If the time is expired i go through the collections of form and table and close all those...
4
by: Robert | last post by:
Have main form with an unbound subform1 which is used for data entry. Subform1 has a nested continuous unbound subform (subform2) which is used to enter multiple records related to the record being...
20
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
4
by: madereal | last post by:
howdy scriptors… here’s my question: Project Background: I’m creating a database that will hold questionnaire data. Situation: I would like to set up a combobox with a changing rowsource...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
6
kcdoell
by: kcdoell | last post by:
Hello: I three fields on a continuous form: , & On the same form I have an unbound text box with the following formula in the control source: =Sum(IIf(=50,,0)) This worked great.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
tracyyun
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...
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.