Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Not In List and a Date

Posted on 2014-11-16
3
Medium Priority
?
151 Views
Last Modified: 2014-11-16
Experts,

I have the code below that inserts text if the text is not in the drop down list.
It works fine.
I need to modify as the options are no longer text but now they are dates (cboInitiates is a date...not text).
I think I have to change the Dim Msg ast String to something else but I think  I need to make a change elsewhere.

Please let me know where to make the edits.

thank you
let me know if you need additional info.


Private Sub cboInitiates_NotInList(NewData As String, Response As Integer)

    
         Dim Msg As String
On Error GoTo cboInitiates_NotInList_Err
blAddBank = False  'this needs to match the on load of the ad list form below in
    If NewData = "" Then Exit Sub
    Msg = "'" & NewData & "' is not on the list." & vbCr & vbCr
    Msg = Msg & "Do you want to add it?"
    If MsgBox(Msg, vbYesNo + vbQuestion, "NotListed") = vbNo Then
        Response = acDataErrContinue
        Me.cboInitiates.SelStart = 0
        Me.cboInitiates.SelLength = Len(Me.cboInitiates.Text)
        
        Else
        DoCmd.OpenForm "frmImportantDate_Add", , , , acFormAdd, acDialog, OpenArgs:=NewData
                                
        If blAddBank Then
            Response = acDataErrAdded
            Me.cboInitiates.RowSource = Me.cboInitiates.RowSource
            Else
            Response = acDataErrContinue
        End If    


    End If

cboInitiates_NotInList_Exit:
    Exit Sub
cboInitiates_NotInList_Err:
    MsgBox Err.Description
    Response = acDataErrContinue
    Resume cboInitiates_NotInList_Exit


End Sub

Open in new window

0
Comment
Question by:pdvsa
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40446536
try changing this

Private Sub cboInitiates_NotInList(NewData As String, Response As Integer)


with

Private Sub cboInitiates_NotInList(NewData As Date, Response As Integer)
0
 

Author Closing Comment

by:pdvsa
ID: 40446545
Thank you
Perfect
0
 
LVL 3

Expert Comment

by:jcrozier21
ID: 40446548
What is the specific error message you are getting? Which line is highlighted when the debugger stops the process?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question