Ask the MultiValued Visual Basic Expert

(as published in Spectrum magazine)

Click on the left for just the question (faster), or on the right for the question and answer...

bulletSep/Oct 1999 Question - Non-proportional Fonts
bulletSep/Oct 1999 Question - Setting Focus to a Variable Control
bulletMay/Jun 1999 Question - Client Link OCX for mvBASE
bulletMar/Apr 1999 Question - Stay MultiValue or go Mainstream?
bulletJan/Feb 1999 Question - Loading Custom menus
bulletJan/Feb 1999 Question - The True/False Trap
bulletNov/Dec 1998 Question - SELECT and READNEXT Windows Files
bulletNov/Dec 1998 Question - Fast Field Load and Update
bulletSep/Oct 1998 Question - Disabling the 'X' Close Button
bulletSep/Oct 1998 Question - Packaging a VB Application
bulletJuly/Aug 1998 Question - Popup Menus from a Right Mouse Click
bulletMay/Jun 1998 Question - 486 Upgrade
bulletMay/Jun 1998 Question - VB and the Year 2000
bulletMar/Apr 1998 Question - Laptops and AP/DOS
bulletJan/Feb 1998 Question - Visual Basic Event Sequences 3 Jun 97
bulletNov/Dec 1997 Question - News Groups
bulletJuly/Aug 1997 Question - Validating Field Data
bulletMay/Jun 1997 Question - Searching a List as the User Types 11 Mar 97
bulletMar/Apr 1997 Question - Printing a Word Document with data from VB 19 Aug 98
bulletJan/Feb 1997 Question - Using the Enter key to go from field to field 5 Mar 99
bulletNov/Dec 1996 Question - Using the Grid control to edit multivalues 1 Jan 97
To email your questions to "Ask the MultiValued VB Expert", click here.
Copyright 1996-99 Caduceus Consulting. All rights reserved.
Revised: August 18, 1999.

Return to Caduceus Consulting Home Page

Sep/Oct 1999 Questions

Setting Focus to a Variable Control

I wonder if you can help. I am trying to set focus to a control specified by the value of a string . However, it is not proving to be as easy as it should be. When I am trying to "Set" the name it either will not accept the value as there is a Type mismatch or it won't accept the name we try to assign to it because this is a read-only property. Are there any work-arounds or cunning solutions ? Here is the code I was trying:

Dim objvar As Control
Set objvar = Text2.Text
objvar.SetFocus

Joe Aeberhard, U.K.

OUR ANSWER...

Also in this issue:

Non-proportional Fonts

If I capture the output of a report from the host and then place the results in a text box, the report is not formatted. If I use the fonts Terminal or System the report looks O.K.

If I highlight part of the report and try to change the font, the columns get corrupted (out of alignment). Is there any way to convert the captured text to a specific TrueType font before displaying? If that is possible, further manipulation of the text would not corrupt the column spacing. - S. Schwartz, Triple Creek Software

OUR ANSWER...

Back to Top

Nov/Dec 1998 Questions

SELECT and READNEXT Windows Files

What is an easy way to do a function that you would do to ONE file (say: renaming it), but to do it to ALL files on a drive without having to click on each file. I have read four or five VB4 and VB5 books and have never seen code that relates to this. - R. Shepheard, Relte Corporation

OUR ANSWER...

Also in this issue:

Fast Field Load and Update

I'm used to having a 4GL that quickly created reasonably useful data entry and retrieval screens for me in my character-based applications. I find VB more tedious, in that whenever I read in an item from my MultiValue host, I have to go through and populate all of my text boxes and other controls by hand. Each attribute must be extracted and its value assigned to the appropriate control (sometimes with a conversion). Then I have to write code to reverse it all when I save the screen. Any ideas on how this might be done more efficiently?

OUR ANSWER...

Back to Top

May/June 1998 Question

486 Upgrade

Our company has some PICK/BASIC programs running on PC-PICK R83 V3.1 (17 users) on Intel 486 CPU. However, our 486 CPU is very old and it may HALT sometimes. We want to upgrade the CPU to Intel-586. However, the current PICK cannot support the Intel Pentium CPU. Please advise.

Thanks. - Alex Mak

OUR ANSWER...

Back to Top

May/June 1999 Question

Client Link OCX for mvBASE

We are a large site running mvBASE and developing VB front-ends for our applications. We acquired the Client Link OCX from GA, expecting to get VB/mvBASE connectivity, but we can’t make head or tail of the documentation or what it’s supposed to do. Do you have any experience with this tool? - Paul S., Wisconsin

OUR ANSWER...

Back to Top

Sep/Oct 1998 Question

Disabling the 'X' Close Button

Dear Andrew:

I had the pleasure of attending your Visual Basic Class for Pick Programmers recently and have begun developing in VB5. I have a question that I hope you can answer: How can I disable ONLY the ‘X’ (Close) [on a Visual Basic form]? I’d like to keep the Minimize and Maximize buttons but drop the ‘X’. I can’t seem to achieve this at either design time or run time. - Alex Vlassis

OUR ANSWER...

Back to Top

Mar/Apr 1998 Question

Laptops and AP/DOS

I often read your articles in Spectrum magazine and have some questions regarding a development issue. I have created a order processing application for laptops, written on AP/DOS. Merchants take their laptops in the field, enter orders, and perform various analyses based on downloaded data. That's all great, however, I would like to interface some Visual Basic programs with this AP/DOS database and have merchants run the VB programs. The host is the laptop. My questions are as follows:

  1. There are many laptops – are VB run-time licenses required to execute a VB program?
  2. Can a VB program work with AP/DOS or do I need to upgrade AP/DOS? Is that a costly upgrade for each laptop?
  3. Is D3 the only way to upgrade a PICK application running from windows? Currently they are using Windows 3.1. Do I have to upgrade them to Windows 95 in order to use any VB interface?

I know that's a lot of questions, but if you can help me, I would surely appreciate it. Thanks. - M. Margulis, New York

Many user actions invoke multiple Visual Basic events, but which events? and in what order? None of the VB manuals appear to document this, but I recall that you had researched this. Would you share your results? - L. Burstein, Dynamic Systems

OUR ANSWER...

Back to Top

Jan/Feb 1999 Question

Loading Custom Menus

I want to create a menu at run-time in a VB application. The Load statement can create one level of menu, but how can I create a multi-level menu (i.e. menu entries with sub-menus)? - Ajay Singh

OUR ANSWER...

Back to Top

Nov/Dec 1997 Question

News Groups

The time has come for me to add a GUI front-end to my MultiValue database. Visual Basic seems to be the most popular language, but lately I've been hearing a lot about Delphi. Which do you think is better?

I want to move my old 'Pick' applications on to an NT box. There are now at least four flavors available: uniVerse, D3, mvBASE, and Unidata. Any recommendations?

My company sells packaging products, not computers. The guy who sold us our Pick-based software is going out of business. We have no money for a high-priced consultant. Where can we go for help?

OUR ANSWERS...

Back to Top

Sep/Oct 1998 Question

Packaging a VB Application

Dear Andrew:

It was a pleasure talking to you again at the recent Spectrum conference. As always, I found your presentations very helpful.

I do have a couple of questions relating to VB which may even be worthy of discussion in your column:

My first question concerns ‘packaging’ a VB application. All of the examples of VB applications which I have seen have been fairly small - an Order Entry screen, for example. However, we developers generally deal with larger collections, such as a distribution system, where Order Entry would be only a small part. I have not found any discussion of, or guidelines for, packaging and distributing these larger ‘systems’. Surely there must be topics which must be considered. Can you shed some light on this topic?

My second question concerns the use of function keys. Microsoft seems to use them freely. I know we can detect the user pressing a function key in several places, such as the form KeyPress event (with KeyPreview enabled). Are there any traps we might fall into or things we should be aware of when using function keys?

As always, thanks for your assistance! - Ralph Justus, Rivendell Computer Systems

OUR ANSWER...

Back to Top

July/Aug 1998 Question

Popup Menus from a Right Mouse Click

I caught your class at Spectrum in March and thought it was terrific!! I have been looking through my help documentation and books at hand and could not find an answer to this problem. You said that if we had a question, you would take a stab at it, so here goes.

I would like to make a list box visible when the user clicks the right button on a certain text box, but have been having trouble with the default (Undo, Cut, Copy, Paste, Delete, Select all) window popping up before or after my list box appears depending on whether I put the code in the mouse down or mouse up event.

Do you know of a way to disable this or get around it? Any help would be much appreciated. - Steve Shaffer

OUR ANSWER...

Back to Top

Mar/Apr 1997 Question

Printing a Word document with data from Visual Basic

Our manufacturing company requires the ability to read data from a Pick-type host, edit it in Visual Basic, and then print it from MSWord. I am told that this is possible, but the VB manuals are not much help. The WinLink product from Via Systems will get the data into VB but then I’m stuck. Can you assist us? - R. Sullivan, Lavelle Industries

OUR ANSWER...

Back to Top

May/June 1997 Question

Searching a List as the User Types

Many commercial packages have a real nice way of looking up information, searching through a list of options as you type and narrowing the possibilities as you enter more letters. How can I do the same thing for a client name list? What if my client list is on my MultiValue host? - R. McLaughlin, Keystone Mercy Health Plan

OUR ANSWER...

Back to Top

Mar/Apr 1999 Question

Stay MultiValue or go Mainstream?

My corporation has an extensive suite of applications for the job shop manufacturing industry. It is proven software, requiring only one Pick/Basic maintenance programmer. Our plan is to make extensive use of web technology in a whole new incarnation of the package, and we now have a number of Microsoft Certified professionals on staff. I have read about your utilities to translate Pick/Basic code to VB. I am also gathering information on the many ways to connect Windows to a MultiValue database, such as terminal emulator GUI-izing tools, ActiveX objects, etc. Any recommendations? - G. Puffett, Data.Com International

OUR ANSWER...

Back to Top

Jan/Feb 1999 Question

The True/False Trap

I read your column on your web site since I don't get the Spectrum magazine. Thanks for all the tips and sample code. This question may not rate publishing, but I would really appreciate some help.

I wrote my own VB function called APIndex that works like the old INDEX function, but while converting some Data/Basic code to VB, I encountered a problem. My original code read: "IF NOT(INDEX(CMD,"/",1)) THEN". My new VB code reads: "If Not APIndex(Cmd$,"/",1) Then". The problem is that the Else clause never runs, regardless of whether Cmd$ has a "/" or not. I rewrote the code to make it work, but I don't understand why my first attempt did not. Can you explain it? - Jennifer C., N.S.W., Australia

OUR ANSWER...

Back to Top

Jan/Feb 1997 Question

Using the Enter key to go from field to field

We are rewriting our main data entry screen from a character-based program on a uniVerse platform to Visual Basic. Unfortunately our users are used to using the Enter key to move from field to field, not the Windows standard Tab key. How can I give them back their Enter key and are there any problems with that? - A. Crocker, B & G Insurance

OUR ANSWER...

Back to Top

Nov/Dec 1996 Question

Using the Grid Control to edit multivalues

I want to edit the contents of a multi-valued string that I have brought into VB from my Pick-type host, but VB’s Grid control seems to be limited to display only. What is the best way to edit multi-values, especially across more than one attribute? - W. Campbell, Intellidata Inc.

OUR ANSWER...

Back to Top

July/Aug 1997 Question

Validating Field Data

I have a series of text boxes on a form. The first one is called PartNum and the second one is called OrderNum. I want to be able to validate that the part number is on file, and if not, then to display "Item X is not valid" and allow entry of the part number again. So in the PartNum_LostFocus event, if the part is invalid, I display the error message and then do a PartNum.SetFocus to return to that field.

What is happening, is that the error message "Item X is not valid" is displayed, but then it is executing OrderNum_LostFocus before it is going back to PartNum_GotFocus. Why does the OrderNum_LostFocus code get run? I am baffled! - J. Smith, Western Design Howden

OUR ANSWER...

Back to Top

May/June 1998 Question

VB and the Year 2000

How does Visual Basic handle the Year 2000? You may be very surprised!

OUR ANSWER...

Back to Top

Jan/Feb 1998 Question

Visual Basic Event Sequences

Many user actions invoke multiple Visual Basic events, but which events? and in what order? None of the VB manuals appear to document this, but I recall that you had researched this. Would you share your results? - L. Burstein, Dynamic Systems

OUR ANSWER...

Back to Top

To email your questions to "Ask the MultiValued VB Expert", click here.
Copyright 1996-99 Caduceus Consulting. All rights reserved.

Copyright 2006 intellact
Last modified: Thursday May 25, 2006