Not In list new issue (1 Viewer)

yammers4

Registered User.
Local time
Today, 10:08
Joined
Feb 25, 2012
Messages
19
Hi

My database has had an overhall, however I have noticed that the not in edit list now does not work for our player and opp player boxes.

Could someone please have a look and put it right please.

how it should work is when I enter 1st name and surname it should add them to the 1st name and surname colums of the playertbl.

thanks
 

Attachments

  • Langley B2012 Stats and averages.zip
    480.9 KB · Views: 63

Fuse3k

Registered User.
Local time
Today, 05:08
Joined
Oct 24, 2007
Messages
74
Without looking at your application, you would need to do something like this in the NotInList event of the Combobox :


Code:
Private Sub cmbSales_Resource_NotInList(NewData As String, Response As Integer)


    Dim strUserResponse As Single
    Dim db As DAO.Database
    Dim RS As DAO.recordset
    
    'Open a connection to the tblSalesResources table
    Set db = CurrentDb()
    Set RS = db.OpenRecordset("tblSalesResources")
    
    'Prompt user. Tell them the item isnt in the list and ask them if they want to add it. 
    strUserResponse = MsgBox("""" & NewData & """" & " was not found in the list." & vbCrLf & _
        vbCrLf & "Would you like to add this Sales Resource?", vbYesNo + vbInformation, "Item Not In List")
    
    'if the user said yes, add the NewData (i.e. new combobox item) to the table. 
    If strUserResponse = vbYes Then
        RS.AddNew
            RS![Sales_Resource_Name] = NewData
            RS![Active] = True
        RS.Update
        RS.Close
        Response = acDataErrAdded
    Else
        Me.cmbSales_Resource.Undo
        Response = acDataErrContinue
    End If
    
    Set db = Nothing
    Set RS = Nothing
 

Users who are viewing this thread

Top Bottom