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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undo save for not complete records

Status
Not open for further replies.

mohebk

MIS
Aug 23, 2005
139
US
Hi,
I am accessing a table through a form. When i click on the next button until I reach the end or when I click to add a new record and not enter any data, I end up with blank records with only the ID (auto number) value. Is there a way I can undo the recored if certain fields are not filled?
Thanks

Mo
 
A common way is to enforce all the validations rules in the BeforeUpdate event procedure of the form, playing with the Cancel parameter.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, I will try that.

I have another issue. I am trying to make two fields a mirror of each other. Meaning whenever field1 is changed on the form, the other needs to get the same value.

I tried field1.text = field2.text but I got an error (You can't reference a field that does not have the focus).

I created a variable in the general declaration to store the value. I did field1.setfocus but whenever I use the field.text = variablVlue I get an error that says (you can't reference a property or a method...)

Can you please help?
Thanks


Mo
 
Use the Value property instead of the Text one.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Another way to enforce all fields being filled in would be to set the required and allow zero length properties of those fields on the table. Then the database won't save a record that is not complete. This however can cause rather codey looking error messages, but can be a good idea if you have multiple ways of saving info to the database (i.e. website, forms, other programs, etc).

"God is a comedian playing to an audience too afraid to laugh."
-- Francois Marie Arouet (Voltaire)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top