Frm Lvl CmdButton issue with required fields

al0y0u

New member
Local time
Today, 20:00
Joined
Apr 5, 2002
Messages
7
okie lemme see if i can explain this easy enough

I have a simple cmdButton that opens a diff frm and closes the excisting frm. Not a problem so far

now heres the problem

when using the standard x in the corner to close a form you will be prompted if you have forgotten to fill in a required field.

using a cmdbutton does NOT and does not save the record or tell the user that there was even a problem.

i am somewhat fluent in vba but this problem eludes me so far.
what i need is way for it to verify all the data and prompt if not all required fields are not filled in.

I suppose i could do this with a ton of vba code to check each box each time but I am thinking there has got to be an easier way to do it.
any suggestions would be grateful

al0y0u
 
In the Forms Before Update event use code loop through all the fields on the form and if any are Null then pop up a message box, set the focus to the offending field and cancel the update...
 
yea ok but to do that simply wouldnt all the fields have to be contained in an array
or is there a way ...

hmmmmmmmmm
also i havent been able to make a msg box appear for some reason.

always frustrating when your this close to having something done and hung up on one issue lol
 
Search help for Control Object and look at the example there on a way to loop through the fields on the form.

If your message box is not working then put a Stop in your code and step through it to find out why.
 
it was getting to it because it was in an ERRORHANDLER

and since there was never technically an error thrown in the vba no need to goto

so argh

thanxs for advice ill check that out in help
 

Users who are viewing this thread

Back
Top Bottom