Sue22
Registered User.
- Local time
- Today, 20:41
- Joined
- Mar 11, 2015
- Messages
- 37
Hi After a lot of struggling I managed to get this to work OK:
It is used to warn if a duplicate value for a Module is being added on a sub form. There are instances where there can be two modules so I don't want to prevent duplicates just a warning you are adding one. I could just leave it as it is but in instances where it is an error Ideally a click of a button would remove the erroneously created record so:
What I want the Dialogue to ideally do is have a Yes/ no question which is :
"You have already entered this module code, do you want to delete this record?"
If the User clicks Yes the current record on the sub form is deleted. If the user clicks No they can continue to update the remaining parts of the record.
I think this should be straightforward but have been fiddling with it for ages and can't see the wood for the trees anymore :banghead:
Thanks
Code:
[FONT=courier new][SIZE=2]Private Sub Module_Code_AfterUpdate()
Dim strCriteria As String
strCriteria = "Module_Code=" & Chr(34) & Me.Module_Code & Chr(34) & " AND Course=" & Chr(34) & Me.Course & Chr(34)
If DCount("Module_Code", "tbl Stages", strCriteria) > 0 Then
MsgBox ("You have already entered this module code")
End If
End Sub [/SIZE][/FONT]
What I want the Dialogue to ideally do is have a Yes/ no question which is :
"You have already entered this module code, do you want to delete this record?"
If the User clicks Yes the current record on the sub form is deleted. If the user clicks No they can continue to update the remaining parts of the record.
I think this should be straightforward but have been fiddling with it for ages and can't see the wood for the trees anymore :banghead:
Thanks
Last edited: