Results 1 to 8 of 8
  1. #1
    eireguy is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    5

    Find a record by entering number in a text / combobox

    Hi everyone,



    I have a business repairing electronic items for the entertainment industry,please forgive me for asking what must be such a simple question, but I can't seem to get this to work.

    I have a form which shows customer information and a subform showing repair details for that customer, all based on underlying tables. So customer 100 might have 6 repairs, customer 200 might have 3 repairs etc.

    I would like to have a text or combo box into which I can enter a repair ID number and press "enter" on the keyboard to find the record associated with it, in other words the result would go to the corresponding form / subform. The box can be on the repair details subform or on the customers form if that makes any difference.

    I hope I have made myself clear and if you need further info please let me know, thanks v. much in advance for whatever help you can give me, regards, John.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    John,

    Here's a short video by Steve Bishop on subform filtering that shows a technique that you may be able to use.
    Good luck.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    the tCust table:
    CustID (auto)
    FirstN
    LastN, etc..

    the tCustRepair (sub table)
    RepairID (auto)
    CustID (long)
    InDate
    OutDate
    RepairDescr....etc

    the master form would show 1 record of the Customer
    the subform would connect to the tCustRepair table
    the PROPERY of the subform would be bound to the CustID:
    LINK MASTER FIELD: CustID
    LINK CHILD FIELD: CustID

    then all data you enter in the subform will auto fill the tCustRepair.CustID


    in a form that shows ALL records,
    an unbound box to enter the search term:
    Code:
    sub txtFind_Afterupdate()
    If IsNull(txtFind) Then
       Me.FilterOn = False
    Else
       'Me.Filter = "[ItemName] like '*" & me.txtFind & "*'"
       Me.Filter = "[ItemName] = '" & me.txtFind & "'"
       Me.FilterOn = True
    End If
    end sub
    then open that record:
    docmd.openform "fMasterForm",,,"[ClientID]=" & txtID


  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    John

    I've attached a very simple db that does what I think you require.
    Use the "Find JobID" combo box in the Header section.
    Post back if it is the kind of thing that you want and you need any help to implement it in your own db.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    eireguy is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    5
    Thanks very much for that, I appreciate the suggestion and I'll try it and let you know, best regards John.

  6. #6
    eireguy is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    5
    Cheers Bob, I'll try that, much appreciated, regards, John

  7. #7
    eireguy is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    5
    Appreciate that Ranman, I'll give it a go and let you know, stay safe and best regards John

  8. #8
    eireguy is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2020
    Posts
    5
    Hi again guys,

    This seems to be a blind spot for me, I designed the DB about 10 years ago but I seem to have misplaced the knowledge I had to make it, hence the question ! Maybe if I state the problem in more simple terms ?

    I want to;

    1) Add a text or combobox to a subform.
    2) Enter a number in one of those.
    3) Display the repair ID that matches that number. The subform has a field based on a table named "repair id"
    4) Thats it !!

    Please make allowances for me, I'm not even a novice at this stage and VBA is (generally) beyond my talents.

    Many thanks to you all,

    Regards and stay well and safe, John

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

Similar Threads

  1. Replies: 2
    Last Post: 03-16-2018, 09:44 AM
  2. Find record from combobox data
    By Brightspark98 in forum Forms
    Replies: 1
    Last Post: 02-04-2017, 04:32 PM
  3. Replies: 17
    Last Post: 12-31-2015, 09:39 PM
  4. Replies: 3
    Last Post: 11-12-2015, 09:36 PM
  5. Macro to find last record number?
    By dniezby in forum Programming
    Replies: 6
    Last Post: 04-30-2013, 12:44 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