forms

jonamua1971

Registered User.
Local time
Today, 00:45
Joined
Mar 3, 2007
Messages
97
hay
i have done a database and everything seem to be working fine so far. my question is?? i want users not to delete others people's data but at the same time be able to enter new data. or is it possible the database should ask them to save data before they go to the next one. i know it will require to change the default setting of "savings":) in forms. please help .:D
 
thank you very much for your response. i tried that but its not working good.
how about if the database ask before saving the record. that can also do. i understand what you said about puting user names. any help with saving records
 
In the BeforeUpdate event of the FORM, put in

Code:
     If MsgBox("Are you sure you want to save this record?", vbYesNo + vbQuestion, "Save Confirmation") = vbNo Then
        Cancel = True
        Me.Undo
     End If
 
thanks again.
iam not very experienced with vba. when i tried to do what you told me it said. compile error
only comments may appear after endsub end fuction property.
what did i do wrong??
nd Sub
If MsgBox("Are you sure you want to save this record?", vbYesNo + vbQuestion, "Save Confirmation") = vbNo Then
Cancel = True
Me.Undo
End If
 
form

man igore the last reponse!!
great !1 got it. it worked just fine. thank you very much.
hay , can i do the same with delete?? can it ask them before they delete? if not, that will work.
thank you
 
hidden records in a form

i have a form that many users use to enter data but my concern is that others may delete other people's data by mistake. how can i hidden data that has been entered in the form. is it possible that when the form opens it only shows the blank form ready to enter data. if i have to do this, how can i do it. which property do i change and how is the code going to look like.
thanks you guys in advance for youe help.
 
i have a form that many users use to enter data but my concern is that others may delete other people's data by mistake. how can i hidden data that has been entered in the form. is it possible that when the form opens it only shows the blank form ready to enter data. if i have to do this, how can i do it. which property do i change and how is the code going to look like.
thanks you guys in advance for youe help.

Code:
Private Sub CmdOpenReports_Click()
On Error GoTo Err_CmdOpenReports_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "YourFormName"
     DoCmd.OpenForm stDocName, , , stLinkCriteria
      DoCmd.GoToRecord , , acNewRec

Exit_CmdOpenReports_Click:
    Exit Sub

Err_CmdOpenReports_Click:
    MsgBox Err.Description
    Resume Exit_CmdOpenReports_Click
    
End Sub

A simple way to do this. It will open the form then move to a new blank record ready for input.

On edit: If this form opens with the db (without a command button) then put this sub in the ON LOAD event of the form - and delete the first DoCmd.
 
Last edited:
In the BeforeUpdate event of the FORM, put in

Code:
     If MsgBox("Are you sure you want to save this record?", vbYesNo + vbQuestion, "Save Confirmation") = vbNo Then
        Cancel = True
        Me.Undo
     End If
hay
its working fine but when i close the database the record saved disappears when i open it again
how can i correct that
 
In the BeforeUpdate event of the FORM, put in

Code:
     If MsgBox("Are you sure you want to save this record?", vbYesNo + vbQuestion, "Save Confirmation") = vbNo Then
        Cancel = True
        Me.Undo
     End If
its been solved. thanks very much
 

Users who are viewing this thread

Back
Top Bottom