Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


General pointer needed (Just a quickie!)

Posted on 2000-02-23
Medium Priority
Last Modified: 2010-05-02

I'm new to the game - only just mastering VB fundamentals and don't have access to a  manual that provides an answer to this one. Can anyone help?

I am building a front end that sends data to /returns data from an AS/400 via .dll objects talking to AS400 data queues.

The nature of the AS400 dictates that the data is sent/received as a text string yet it will consist of a mixture of text & numeric values.

I need to be able to convert interger values to fixed length text strings that can then be re-converted at the AS400 end.


I have an item counter that takes up seven 'spaces' of the data block, passed to the data queue

If the integer value of that counter is 26

     Dim strVar as String * 7

     intVar Cstr strVar

Then strVar would look like this "26     "

I need to be able to send this data back to the AS400 as "0000026"

Any pointers?


Question by:Matt_Unsworth
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

jetforce earned 60 total points
ID: 2549949
try something like this

Dim x As String * 7
Dim i As Integer

i = 26

x = Format(CStr(i), "0000000")
MsgBox x


Expert Comment

ID: 2549968
strVar = format(intVar, "0000000")

Author Comment

ID: 2550036

Clean, simple effective; (why did I not think of that, DOH.........)


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question