Selasa, 24 Desember 2013

[MS_AccessPros] How to modify this code for numeric field

 

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 = False
    CmdCloseAddRcrdClient.Enabled = True
    CmdAddRcrdClient.Enabled = True
    
    Dim SID As String
    Dim stLinkCriteria As String
    Dim rsc As DAO.Recordset

    Set rsc = Me.RecordsetClone

    SID = Me.ClientCIN.Value
    stLinkCriteria = "[ClientCIN]=" & "'" & SID & "'"

    'Check Clients table for duplicate ClientCIN
    If DCount("ClientCIN", "Clients", _
              stLinkCriteria) > 0 Then
        'Undo duplicate entry
        Me.Undo
        'Message box warning of duplication
        MsgBox "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 ClientCIN
        rsc.FindFirst stLinkCriteria
        Me.Bookmark = rsc.Bookmark
    End If
    Set rsc = Nothing
End Sub

Khalid
Kh

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar