Results 1 to 7 of 7
  1. #1
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16

    Searchbox to find record by IssueID


    Hi,

    Could someone help me or direct me how i can create a searchbox so that i can find records based on the unique reference number IssueID for the following database https://www.dropbox.com/s/82r23mqc4s...017.accdb?dl=0. Many thanks ahead.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The button opens the query:
    docmd.openquery "qsMyQuery"

    the query uses the text box in the criteria:
    select * from table where [field]=forms!myForm!txtFind

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Country Form v03042017 davegri.zip

    See attached. I changed the textbox to a combobox and got rid of the update button.

  4. #4
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Hi thanks for the inputs but could you explain how you did that, please explain step by step like what buttons to press and where to make the inputs? What properties in the property sheet did you add to the combobox to make it the way it is? And if I want to change it to select a list of IssueIDs how do i change that?

    Thanks a lot for your inputs its more or less what i was looking for, i am really new to access and am trying to learn.

  5. #5
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Take a look at this video:
    https://www.youtube.com/watch?v=vuiKb8jeKTM
    https://www.youtube.com/watch?v=vuiKb8jeKTM

    Here's the code:

    Code:
    Option Compare Database
    Option Explicit
    Private Sub cboIssueSearch_AfterUpdate()
        Dim rs As Object
        Set rs = Me.Recordset.Clone
        rs.FindFirst "IssueID = " & Me!cboIssueSearch.Column(0)
        If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub
    Private Sub cboIssueSearch_NotInList(NewData As String, Response As Integer)
        MsgBox "That IssueID, " & NewData & " does not exist", vbOKOnly + vbInformation, "  N O   S U C H   I S S U E   "
        Response = acDataErrContinue
    End Sub
    Here's the properties of the combobox

    Attachment 28109Attachment 28110

  6. #6
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Hi thanks for the quick reply, i am really new to MS access could you guide me as to how to add macros?

    I notice that you were able to add your macro to a form

    Click image for larger version. 

Name:	VBA macro.png 
Views:	6 
Size:	28.2 KB 
ID:	28112
    However when i tried to do it myself using a fresh database that also had a form i am not sure how to add a Microsoft access class object. Could someone assist me?

    Click image for larger version. 

Name:	How to add VBA macro.png 
Views:	6 
Size:	27.6 KB 
ID:	28113

  7. #7
    kchm2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    16
    Hi guys nevermind, i found out how to update already. Just go to the property sheet and click event to update it. thanks

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

Similar Threads

  1. Replies: 1
    Last Post: 06-23-2014, 07:21 AM
  2. Replies: 1
    Last Post: 05-26-2014, 12:39 PM
  3. Replies: 4
    Last Post: 04-01-2014, 02:33 PM
  4. SearchBox and Datasheet View
    By gio25 in forum Forms
    Replies: 3
    Last Post: 03-23-2011, 06:07 PM
  5. Help Creating Searchbox with "suggestions"
    By cnstarz in forum Forms
    Replies: 3
    Last Post: 10-11-2010, 06:14 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