|
-
Sep 18th, 2000, 10:56 AM
#1
Thread Starter
Junior Member
I have an access97 db attached to my vb 5 program with DAO. When I type a record in it will save the record to the database no matter what. So if the user doesnt complete fields the record is still saved to the database. Does anyone know how to not save the record to the database say if a certain field wasnt filled out?
So it would abandon the record if certain fields were not completed??
Thanks
-
Sep 18th, 2000, 11:06 AM
#2
Addicted Member
You can put this code inside the button on which you press to put the data in the Access Table.
private sub cmd????()
if ucase(trim(txt???)) = "" then
msgbox "This field needs to be filled out", , "Missing Data"
txt????.setfocus
exit sub
end if
This code will not allow the user to save until the field is filled out.
Hope this helps you out!
-
Sep 18th, 2000, 11:11 AM
#3
Thread Starter
Junior Member
But if i enter information on the form and exit out even if I dont click on save then come back into the program the partial data is still listed in the database
-
Sep 18th, 2000, 11:30 AM
#4
Lively Member
Don't use the AddNew method until your user presses a "Submit" button. Then, validate the entries, add a new record and populate the database fields.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|