borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Null Record)Next Topic (VB6 and communication) New Topic New Poll Post Reply
AndreaVB Forum : Database : Form Solved Topic
Poster Message
bolendercm
Level: Scholar


Registered: 25-10-2005
Posts: 39

icon Form



I have a table called SYSTEM RESTART.  Along with that table I have a data input form called SYSTEM RESTART.  If the user opens the SYSTEM RESTART form the date and time will automatically display on the input form.  However, if the user opens the form by mistake, realizes it and closes the form, it still shows up in the dB as a record.  How do I build a form that will NOT save the data when the user hits the EXIT button.  There are two modal buttons at bottom of the form.  SAVE and EXIT.



____________________________
C.......................

12-12-2005 at 08:03 PM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 910
icon Re: Form

quote:
If the user opens the SYSTEM RESTART form the date and time will automatically display on the input form.  However, if the user opens the form by mistake, realizes it and closes the form, it still shows up in the dB as a record
I guess it happes because you open the form in a connected mode. I mean, you linked all the controls to the fields of a recordset, setting their DataField property, isn't it?

It's better working disconnected. You open a form and show in the textbox the current date and time. When you close the form nothing happens, as the textboxes have their DataField property not set, so they have no place to store their data. They are just some unbound control, not different from the textbox in old HelloWorld.exe.
If you need to save data you do it explicitly, by clicking the Save button. In this case you open the recordset, move to the new/desired record, edit the fields, save and close the recordset.
quote:
How do I build a form that will NOT save the data when the user hits the EXIT button.  There are two modal buttons at bottom of the form.  SAVE and EXIT.
The way I described above, the Exit button will cause only form's unload.

Hope it helps



____________________________
Real Programmer can count up to 1024 on his fingers
12-12-2005 at 11:59 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Form Solved Topic
Previous Topic (Null Record)Next Topic (VB6 and communication) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder