By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,366 Members | 1,366 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,366 IT Pros & Developers. It's quick & easy.

Creating a text box prompt when a form will be altered or deleted

P: 1
I have developed a database to record enquiries for English courses that I offer. Information is entered via forms. Once a record is created, adjustments may need to be made later if the status of the enquiry changes. I want to create a textbox/popup to request confirmation whenever a record in the form will be altered or deleted. Is this possible?
Oct 7 '14 #1

✓ answered by zmbd

Short answer is yes.

- Normal deletes with the system messages turned on should prompt you to confirm. You can also the form's before delete event to place an additional prompt.

- Record edits are trapped in the form's before update event.

In both event cases the most simplistic code could be
Expand|Select|Wrap|Line Numbers
  1.     Dim zMsgRslt As Long
  2.     Dim zAction As String
  3.     '
  4.     zAction = "Delete" 'or change
  5.     uFeedBack = MsgBox("Are you sure you want to " & zAction & "this record?", vbQuestion + vbYesNo + vbDefaultButton2)
  6.     If uFeedBack = vbNo Then
  7.         Cancel = True
  8.     End If
  9.  
Anything more complex would require more detail about your project and which version of Access/Office that you are using.

Share this Question
Share on Google+
1 Reply


zmbd
Expert Mod 5K+
P: 5,397
Short answer is yes.

- Normal deletes with the system messages turned on should prompt you to confirm. You can also the form's before delete event to place an additional prompt.

- Record edits are trapped in the form's before update event.

In both event cases the most simplistic code could be
Expand|Select|Wrap|Line Numbers
  1.     Dim zMsgRslt As Long
  2.     Dim zAction As String
  3.     '
  4.     zAction = "Delete" 'or change
  5.     uFeedBack = MsgBox("Are you sure you want to " & zAction & "this record?", vbQuestion + vbYesNo + vbDefaultButton2)
  6.     If uFeedBack = vbNo Then
  7.         Cancel = True
  8.     End If
  9.  
Anything more complex would require more detail about your project and which version of Access/Office that you are using.
Oct 7 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.