?
Solved

how to check a form input before saving?

Posted on 1998-09-22
2
Medium Priority
?
146 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
[X]
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
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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

762 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