Results 1 to 3 of 3
  1. #1
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89

    msgbox go to new record

    Hi all,
    I have a combo that searches for a record. I get a standard Access message box when the entry in the combo box gets no match and I'd like to somehow modify that so that the user has the option of going back and trying again or going to a new record. The code that's in there at the moment is below. I'm completely new at this part of access so any direction is welcome even if it's only to tell me I'm asking the wrong question or am in the wrong forum section.



    Private Sub Combo47_AfterUpdate()
    On Error GoTo Combo47_AfterUpdate_Err


    DoCmd.SearchForRecord acForm, "Form_part-vnd", acFirst, "[PartID] = " & Str(Nz(Screen.ActiveControl, 0))




    Combo47_AfterUpdate_Exit:
    Exit Sub


    Combo47_AfterUpdate_Err:
    MsgBox Error$
    Resume Combo47_AfterUpdate_Exit

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    make a continuous form with all records,
    put an unbound combo box in the header to find the item. (or text box)
    the afterupdate will then filter (search) for your matches:

    Code:
    sub cboBox_Afterupdate()
    If IsNull(cboBox) Then
      Me.FilterOn = False
    Else
      Me.Filter = "[panel]='" & cboBox & "'"
      Me.FilterOn = True
    End If
    end sub

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Combobox LimitToList is set to yes? You might want to explore the NotInList event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 06-30-2017, 08:58 AM
  2. vba MsgBox for some but not all
    By BusDriver3 in forum Macros
    Replies: 18
    Last Post: 12-15-2016, 09:33 PM
  3. Unmatched record and msgbox
    By Daryl2106 in forum Access
    Replies: 3
    Last Post: 11-01-2013, 05:19 PM
  4. Yes No msgbox
    By imintrouble in forum Access
    Replies: 3
    Last Post: 10-14-2011, 02:24 PM
  5. MsgBox
    By Mtyetti in forum Forms
    Replies: 4
    Last Post: 07-27-2011, 01:51 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