|
-
Nov 22nd, 2000, 11:17 AM
#1
Thread Starter
Hyperactive Member
Is there a way to format with a variable of a certain
format? What I am trying to say is that I have a column
heading "My Title" which I read from the database, but when I print or format the value of this column, I would like to be able to use the same number of chars/length.
So if my_heading is 8 chars long, I would like to
format my_value such as format(my_value,8 of "@@@@@@@@")
as well.
Here is a sample code:
Private Sub Command1_Click()
Dim my_heading As String
Dim my_value As String
my_heading = "My Title" 'varies coz read from dbs
my_value = "Short" 'varie from 1 to 8 chars
Text1.Text = Format(my_value, "@@@@@@@@")
' is there a way to format with a variable "@@@@@@@@"?
' something like format(myStr,n,"@")
End Sub
Thanks in advance for the help.
-
Nov 22nd, 2000, 11:22 AM
#2
You could try:
Format$(my_value, String$(8, "@"))
Just substitute the '8' argument of String$() with a variable.
Paul
-
Nov 22nd, 2000, 11:26 AM
#3
Thread Starter
Hyperactive Member
Thanks, PWNettle. It works great!
Thanks for your help, and have a nice
ThanksGiving holiday.
-
Nov 22nd, 2000, 11:43 AM
#4
You're welcome. You have a nice (and hopefully long) holiday weekend too!
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|