By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,663 Members | 2,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,663 IT Pros & Developers. It's quick & easy.

populating an unbound field in a continuous record form

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.