Results 1 to 2 of 2
  1. #1
    Bruce is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    72

    Not In List event not working

    I'm using a combo-box to present users with a list of people to select from. If the name is not in the list I have the following code:

    Dim i As Integer


    Dim Msg As String
    'Exit this sub if the combo box is cleared
    If NewData = "" Then Exit Sub
    Msg = "'" & NewData & "' is not currently in the list." & vbCr & vbCr
    Msg = Msg & "Do you want to add this new Person?"
    i = MsgBox(Msg, vbQuestion + vbYesNo, "Unknown Person...")
    If i = vbYes Then

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Add_Person"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    Else

    End If

    I enter a new name in the combo box but the Add_Person form never opens. I also added another End if but same result. I need the form to open so the user can also enter the address and phone number for the new person.

    Thanks!

  2. #2
    Bruce is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    72
    Had to set the Limit to List variable. Also found better code where I don't have to use the form.

    Disregard this question.....until I have another problem...hee hee

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Event Calendar Help
    By Nosaj08 in forum Forms
    Replies: 9
    Last Post: 06-11-2010, 11:19 AM
  2. OnClick event
    By HotTomales in forum Forms
    Replies: 1
    Last Post: 12-24-2009, 08:10 PM
  3. Event question
    By nkenney in forum Forms
    Replies: 1
    Last Post: 07-01-2009, 11:34 PM
  4. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  5. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums