Results 1 to 11 of 11
  1. #1
    kent is offline Novice
    Windows 10 Office 365
    Join Date
    May 2019
    Posts
    28

    Do Forms 2.0 text boxes support search function?


    I'm using the Forms 2.0 text box in one of my forms as it has some functions that the standard Access text box does not support. However, I noticed that the Ctrl+F search function does not seem to work properly within the Forms 2.0 text box. Is there a built-in function for searching this text box, or do I need to build my own?

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,477
    I had to try it, never having to use Forms 2.0 basic controls as far as I can recollect. What does "does not seem to work properly" mean? I tested and it seems to find all five records for "Smith". Curious to know what functions this control provides such that you can't use a regular one.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,976
    I had to try it, never having to use Forms 2.0 basic controls as far as I can recollect.....
    Perhaps I've already had one glass too many, or perhaps I'm even more ignorant of Access than I realised, but I've never head of these. What are they and where can I find them please?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,477
    They are ActiveX controls. Click on that in the design tab drop down and you'll see them in the list. Many developers won't use ActiveX controls in a network corporate environment as you probably know, but I don't know if these are an issue as they've been there since I can remember so they will probably remain distributable just from a basic install of Access. I presume it's the custom ActiveX controls that are an issue.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,976
    Quote Originally Posted by Micron View Post
    They are ActiveX controls. Click on that in the design tab drop down and you'll see them in the list. Many developers won't use ActiveX controls in a network corporate environment as you probably know, but I don't know if these are an issue as they've been there since I can remember so they will probably remain distributable just from a basic install of Access. I presume it's the custom ActiveX controls that are an issue.
    Ah! Thank you. I remember Active X controls from many years ago and you're right, I for one haven't used them since I can't remember when, but thanks for the memory
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    kent is offline Novice
    Windows 10 Office 365
    Join Date
    May 2019
    Posts
    28
    There are functions like .CurLine and .SelLength that don't work with the standard textboxes.
    I attached a new Access file with just a form with the Forms 2.0 Text box. When I try to search via Ctrl+F, I get the error "You can't use Find or Replace now".
    Attached Thumbnails Attached Thumbnails AccessIssue.JPG  
    Attached Files Attached Files

  7. #7
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,477
    I've never had an issue using .SelLength with a regular textbox.
    Had a peek at your file - Ctrl+F works on data which is why I can find several instances (records) of "Smith" amongst records. Your control is unbound - basically has no data.
    In my version the message says "Microsoft Access has finished searching the records..." Naturally if there are no records, you can't expect it to find the input value. That would be the last bullet point in the message you show. Perhaps show your CurLine and SelLength (which are properties, not functions) code and maybe someone will spot the problem. Or provide enough detailed info that might lead to other approaches.

    EDIT - Forgot to mention you can search a regular unbound textbox from the navigation search box though (the navigation search box is how I suspect you raised that particular message). Not sure if that will help.
    Last edited by Micron; 06-27-2021 at 12:36 PM. Reason: clarification
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  8. #8
    kent is offline Novice
    Windows 10 Office 365
    Join Date
    May 2019
    Posts
    28
    I tried your suggestion of binding the control to a record, but I got the error "Access finished searching the records. The search item was not found" when trying to search in the text box.
    Attached Thumbnails Attached Thumbnails Search2.JPG  
    Attached Files Attached Files

  9. #9
    Ajax is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    9,233
    the control you are using does not have a .curLine or a .selLength property. An access textbox has a .selLength property. With regards events there are only a few. Suspect you are getting confused with VB (using Visual Studio) or Excel Forms which I believe provides the curLine property.

    So what it is you are trying to do that the standard access textbox can't do, but 'another' textbox control can? If so - where is this other textbox being used?

  10. #10
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,477
    I tried your suggestion of binding the control to a record, but I got the error "Access finished searching the records.
    Afraid I'm stumped. It worked per my post when I added the activex textbox to my form. No idea why. Unless you can specify why you need to use these controls and what it is you're doing with them (i.e why you think you need them) I'm not going to be able to add anything to this.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  11. #11
    kent is offline Novice
    Windows 10 Office 365
    Join Date
    May 2019
    Posts
    28
    I went ahead and made a search function. Thanks!

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

Similar Threads

  1. Search Query Based on Multiple Combo / Text Boxes
    By ItsJustRey in forum Queries
    Replies: 5
    Last Post: 07-20-2016, 02:04 PM
  2. Replies: 12
    Last Post: 07-07-2015, 03:14 PM
  3. Replies: 3
    Last Post: 04-28-2013, 04:10 PM
  4. Forms and filtering with text boxes
    By jlgray0127 in forum Forms
    Replies: 1
    Last Post: 01-16-2012, 02:12 PM
  5. Search function in forms
    By vCallNSPF in forum Forms
    Replies: 1
    Last Post: 03-14-2010, 06:17 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