John,
I tried it before but got errors, Same now.
And what about quotes and SID after [ClientCIN]=
stLinkCriteria = "[ClientCIN]=" & "'" & SID & "'"
What about quotes here:
'Check Clients table for duplicate ClientCIN
If DCount("ClientCIN", "Clients", _
stLinkCriteria) > 0 Then
'Undo duplicate entry
Me.Undo
Khalid
On Tuesday, December 24, 2013 6:19 PM, John Viescas <JohnV@msn.com> wrote:
Kahlid-
I would guess that all you need to do is remove the quotes around this:
stLinkCriteria = "[ClientCIN]=" & SID
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Dec 24, 2013, at 11:42 AM, Khalid Tanweer <khalidtanweerburrah@yahoo.com> wrote:
Hi All,Could somebody help me to modify the following code for a numeric field, the current code is for a text field.Private Sub ClientCIN_BeforeUpdate(Cancel As Integer)CmdUndoAddRcrdClient.Enabled = FalseCmdCloseAddRcrdClient.Enabled = TrueCmdAddRcrdClient.Enabled = TrueDim SID As StringDim stLinkCriteria As StringDim rsc As DAO.RecordsetSet rsc = Me.RecordsetCloneSID = Me.ClientCIN.ValuestLinkCriteria = "[ClientCIN]=" & "'" & SID & "'"'Check Clients table for duplicate ClientCINIf DCount("ClientCIN", "Clients", _stLinkCriteria) > 0 Then'Undo duplicate entryMe.Undo'Message box warning of duplicationMsgBox "Client CIN: '" & SID & "' has already been allotted." & vbCrLf & _"You will now been taken to the record of Client CIN. '" _& SID & "'.", vbExclamation _, "PCTL Accounts - Duplicate Entry"'Go to record of original ClientCINrsc.FindFirst stLinkCriteriaMe.Bookmark = rsc.BookmarkEnd IfSet rsc = NothingEnd SubKhalidKh
__._,_.___
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar