Kamis, 30 April 2020

Re: [MSAccessProfessionals] Add new record not in combo box

you need to add Code to "On Not in List" event of the combo to add the New Client:

Private Sub yourCombo_NotInList(NewData As String, Response As Integer)
    Response = acDataErrContinue
    If MsgBox("Client: " & NewData & " is not on table." & vbCrLf & vbCrLf & _
                "Do you want to add this?", vbQuestion + vbYesNo, "Client Not Found") = vbYes Then
        'If ClientID is not Auto
        'CurrentDb.Execute "Insert into Clients (ClientID) Select " & NewData &  ";"
        CurrentDb.Execute "Insert into Clients (ClientLName) Select " & Chr(34) & NewData & Chr(34) & ";"
        Response = acDataErrAdded
    End If
End Sub


--
Arnelito G. Puzon


_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115479) | Reply To Group | Reply To Sender | Mute This Topic | New Topic

Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar