can't edit record anymore in a form
From: guilin (guilinmifen_at_hotmail.com)
Date: 01/21/05
- Next message: Bill Gates: "Re: Filtering a subform"
- Previous message: Chris: "Re: Form and subform with a many to many relationship"
- Next in thread: Steve Schapel: "Re: can't edit record anymore in a form"
- Reply: Steve Schapel: "Re: can't edit record anymore in a form"
- Reply: John Vinson: "Re: can't edit record anymore in a form"
- Messages sorted by: [ date ] [ thread ]
Date: 21 Jan 2005 06:54:26 -0800
the Allow Edit and Allow Additions properties of the form are all set
to be true but it won't allow me to change records. I used some code to
promp before edit:
**********code starts*********************
Private Sub Form_BeforeInsert(Cancel As Integer)
'ask user if they want to add a record
Dim strMsg As String
strMsg = "Do you want to add a new invoice?"
strMsg = strMsg & "Click Yes to add or No to cancel."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add Record?") = vbYes Then
AllowAdditions = True
Else
Cancel = True
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
'ask user if they want to save the updated record
Dim strMsg As String
Dim intResponse As Integer
strMsg = "You are about to change this invoice detail. "
strMsg = strMsg & "Do you wish to save the changes?"
strMsg = strMsg & "Click Yes to Save or No to Discard changes."
intResponse = MsgBox(strMsg, vbYesNoCancel, "Update Data?")
Select Case intResponse
Case vbYes
Case vbNo
DoCmd.RunCommand acCmdUndo
Cancel = True
Case vbCancel
Cancel = True
End Select
End Sub
**********************code ends**********************************
this form also has a parent form so it can be opened from its parent or
on its own, don't know whether it changes things?
thanks for all advice....................
- Next message: Bill Gates: "Re: Filtering a subform"
- Previous message: Chris: "Re: Form and subform with a many to many relationship"
- Next in thread: Steve Schapel: "Re: can't edit record anymore in a form"
- Reply: Steve Schapel: "Re: can't edit record anymore in a form"
- Reply: John Vinson: "Re: can't edit record anymore in a form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|