Repeating Text within an Unbound Text Box

  • Thread starter Thread starter Altemir
  • Start date Start date
A

Altemir

There must be a simple way of doing this ...

I have a field on my form that holds an integer-valued variable. I
want to use that integer variable to control how many times a character
is repeated in an unbound text box.

For example, using iCount as a variable and using a period as the
character to repeat,

If iCount = 1 then Text Box Value = "."
If iCount = 2 then Text Box Value = ".."
If iCount = 3 then Text Box Value = "..."
If iCount = 4 then Text Box Value = "...."
.... and so on ...

This is a countinous form, so I think that I need to put something
clever in the Control Source property, but I'm not sure what.

Any suggestions?

-- David
 
There must be a simple way of doing this ...

I have a field on my form that holds an integer-valued variable. I
want to use that integer variable to control how many times a character
is repeated in an unbound text box.

For example, using iCount as a variable and using a period as the
character to repeat,

If iCount = 1 then Text Box Value = "."
If iCount = 2 then Text Box Value = ".."
If iCount = 3 then Text Box Value = "..."
If iCount = 4 then Text Box Value = "...."
... and so on ...

This is a countinous form, so I think that I need to put something
clever in the Control Source property, but I'm not sure what.

There is, in fact. The String() function does exactly this.

For display on a continuous Form you'll need to define the string
value in the Query upon which the form is based rather than the
control source. Put into a vacant field cell in the query:

Dots: String([iCount], ".")

and bind a textbox to the Dots field.

John W. Vinson[MVP]
 
Oops ... I neglected to say that I am working in an ADP where the
"String" function is not recognized. Anything similar in ADP?
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
OK ... I guess I got confused just before I went home yesterday ...

String( number, "character_string" ) works fine.
 
Back
Top