Checking for blank fields

Kate

New member
Local time
Today, 04:52
Joined
Jun 27, 2001
Messages
5
I have some code that checks whether the required fields in a form are completed or not when an "Exit" button is clicked. If a required field is left blank then a messagebox appears and the focus is then set at the field missing information. I got the code from one of the forum topics and it works like a charm.

The problem occurs when a user moves onto a new record but doesn't enter anything in any of the fields and then clicks the Exit button. This sets off a loop that prevents the form from being closed without the user filling in the required fields.

Is there any way I can check if all the fields in the form are empty?
 
Hello,

I had exactly the same question / problem. I put the following code behind a button:

text1.setfocus
if text1.text = "" then
text2.setfocus
if text2.text = "" then
text3.setfocus
if text3.text = "" then
msgbox "You didn't enter any information!"
text1.setfocus
end if
end if
end if

Maybe there is an easier way to deal with this problem, but this works fine.

Greetings,

Albert
 
Sorry, didn't explain myself as well as I thought I did.

I want to be able to close the form if there are no entries at all for the record on screen. Presently, if the record has no entries it starts the loop about completing required fields.

Any ideas?
 

Users who are viewing this thread

Back
Top Bottom