Solved

how to check a form input before saving?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

734 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