Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Entering data after pushing button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diogo - 04 Jul 2007 22:38 GMT
OK,
I have serveral forms with several fields to be filled by user has he goes
along.
My problem is this, imagine the user is in field 3 of a form with 5 fileds.
Then he realizes we doesn't want to enter this data, and wants to close the
form.
In my aplication as soon as he starts to fill field 1 Access starts to write
it in the associated table, leaving the rest of the fields to be completed.
Is there a way to prevente this from happening? I would like some sort of
button that only after the user pushes it, would then record the data in the
Table.
Is this possible?
Thanks in advanced.
Diogo - 04 Jul 2007 23:52 GMT
Moving on:
I'm now using the following code that works fine, just a litlle twist I
would like to alter:

   If MsgBox("Do you want to save the changes?", vbYesNo,"Confirm Change")
=  vbNo Then
       Cancel = True
       Me.Undo
   End If

how do I prevent the next message after the user clicks in the (NO) button,
something
like "You can't save this record at this time. ... blablabla...do you want
to close the database object anyway?"

How do I prevent Access from showing that warning? I just adds confusion to
unexperinced users.

Thanks
Ofer Cohen - 05 Jul 2007 00:00 GMT
Where do you have this code?
Also , can you post the full code in the sub?

Signature

Good Luck
BS"D

> Moving on:
> I'm now using the following code that works fine, just a litlle twist I
[quoted text clipped - 15 lines]
>
> Thanks
Diogo - 05 Jul 2007 00:24 GMT
Private Sub Form_BeforeUpdate(Cancel As Integer)

  If MsgBox("Deseja salvar este registo?", vbYesNo, "Confirmar Alterações")
= vbNo Then
       Cancel = True
       Me.Undo
   End If

End Sub

> Where do you have this code?
> Also , can you post the full code in the sub?
[quoted text clipped - 18 lines]
> >
> > Thanks
Ofer Cohen - 05 Jul 2007 00:36 GMT
I assume you are getting this error when trying to close the form, add this
code to the form OnError event

Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 2169 Then Response = acDataErrContinue
End Sub

Signature

Good Luck
BS"D

> Private Sub Form_BeforeUpdate(Cancel As Integer)
>  
[quoted text clipped - 28 lines]
> > >
> > > Thanks
Steve - 04 Jul 2007 23:57 GMT
<<as soon as he starts to fill field 1 Access starts to write it in the
associated table,>>

Most likely that is not true. Access saves a record:
1.  When you move to a new record
2.  When you close a form
3.  When you explicitly tell Access to save a record via code

If you have not done one of the above three things after entering data in
one or more fields, you can erase all your data and NOT SAVE anyhting you
entered by executing the code:
Me.UnDo

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com

> OK,
> I have serveral forms with several fields to be filled by user has he goes
[quoted text clipped - 14 lines]
> Is this possible?
> Thanks in advanced.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.