Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

required to enter in details 1

Status
Not open for further replies.

goodwork

Vendor
Feb 6, 2003
46
GB

I have a "save" button on my form.

Naturally, I put in a somthing like

If IsNull(Combo117) Then
MsgBox "Please enter Form"
Combo117.SetFocus
Else
name_combo.Requery
End If

in the save_click

It works for every combo box, apart from one of them, it will even save the data as empty. I do not want this. Is there any other way to prevent saving data on a form, where there is an empty field?

Thanks a lot



 
Hi

I assume it is a bound form?

If you look at the properties of teh column within the table, in design view, and set required = yes, allowzerolngth = no, that will stop Access from saving a record with a null in the relevant column(s) Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ah! The "allowzerolngth = no" is the culprit!

Thanks so much for your help

A star on the way
 

Can you please tell me what you will do to prevent this problem if it is an unbound form? I have another form which is unbound, and I also want to avoid this

Thanks a lot


 
Hi

If it is not bound, how are you "saving" the data

If you are saving to a table, same technique will work Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top