Solved

how to check a form input before saving?

Posted on 1998-09-22
2
133 Views
Last Modified: 2010-05-03
I'm new in VB. I want to write a program  that ask the user to fill out some text box of Personal Information.  
How to make sure all fields in the form are fill out by User before saving the form?
0
Comment
Question by:kamijp
2 Comments
 
LVL 2

Expert Comment

by:BergJC
ID: 1436099
How are you going know when to save the form? Are you going to have the user press a button? With a little more detail, I can give you what you need.
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 100 total points
ID: 1436100
One method is to set a flag varaible and run thru the items looking for blanks.

Assume you have a control array of text boxes

DIM flag AS BOOLEAN
flag = True    'Assume all are filled
FOR ndx = 1 TO Text1.UBound
 IF len( Text1(ndx).Text ) < 1 THEN flag = False
NEXT ndx

When you get out of the loop FLAG will be False if any item is blank.

BergJC is right, this code should be in the CLICK event of your [Submit] button.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now