Solved

how to check a form input before saving?

Posted on 1998-09-22
2
139 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

776 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