Results 1 to 12 of 12
  1. #1
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22

    Google Search like Option needed, also with different user login features

    Hey Everyone,




    I needed some assistance with this database I am working on. I have attached a dummy database below that has information (Myzip - Dummy database with Disney Characters). The thing is, in the form "Client Details" I need to search for client's name and I need it to be like our Google search. It searches the "Full Name" as I type. I have searched online, but all they have are search features in queries. I require this option in the form, with a drop-down list that shows options as I type. Is that possible? The screenshot below shows the Search area that I have been working with.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	36 
Size:	24.2 KB 
ID:	36228


    Secondly, I have 3 types of Users in the database, "Admin", "User" and "User2", (Password for all is 123)
    User is not allowed to make edits, but they can add a new entry everytime they enter . User 2 can make edits but can't add new information

    (CODE FOR USER)
    Me.AllowAdditions = True
    Me.AllowEdits = False
    Me.AllowDeletions = False
    Me.DataEntry = True

    The issue I am facing is that when we put a new entry in "Add new entry", In the call log area I can't get to "Insert Object". Only for User this option is not showing, but for User2 and admin, when I right click in the call log area, I get the option of "Insert Object". Is it possible to have the insert object show for user? I don't want to login to another ID everytime I want to insert OLE object.

    Click image for larger version. 

Name:	Capture 2.jpg 
Views:	36 
Size:	56.2 KB 
ID:	36229


    Finally, In my automated switchboard, that I have is it possible when User2 logs in, to make the "Add New Entry" not visible. Cause only User needs to add new Entry, for User2 I require only Edits to be made. Is this possible?


    Click image for larger version. 

Name:	Capture 3.JPG 
Views:	36 
Size:	14.1 KB 
ID:	36230

    I've been stuck on this for so many days. I can't seem to find an answer since I'm kind of new to this Access.
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Personally I don't like find as you type as it can slow performance dramatically if you have a large dataset.
    My preference is to complete the search phrase and then run the search.

    However Allen Browne has a very good example of 'FAYT' here http://allenbrowne.com/AppFindAsUType.html

    One way to manage issues with different user levels is to
    1. Have a function GetUserLevel that looks up the value for the current user
    2. Have code on form load event that controls what each user sees

    For example

    Code:
    Private Sub Form_Load()
    
    Select Case GetUserLevel
    
    Case 1
    ....code here
    
    Case 2
    ...other code here
    
    ....
    
    End Select
    
    End Sub
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Hi Ridders52,

    Thank you for the example. I shall go through it. Just confirming, I only require the options to show in the drop down (like Google). I do not want any form to load only options to show, so would it still be slow?

    Also, any suggestions on the insert object feature and the hiding of items on the switchboard for a certain user?

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Client Database_davegri-v02.zip
    Have a look at this.
    Changed the textbox search to combobox to get the dropdown search effect that you want.
    All of the users were opening the form with DataEntry=true. That means that the form will open BLANK for all users awaiting a new record to be typed in.
    User User cannot edit records by your design spec. That's why user User cannot see Insert Object in the context menu.
    Solution is to me.allowedits=true on mouse down event in the Bound Object Frame and allowedits=false on lost focus of the Bound Object Frame.

    Edit: Referring to the Bound Object Frame, my DB does not restrict the new allowedits code to just user User. Needs If...EndIf to restrict that action to just user User.
    Last edited by davegri; 11-19-2018 at 05:46 PM. Reason: clarify the user User...

  5. #5
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Hi Dave,

    Thanks a million! This is absolutely great!! I will definitely study this in detail.

    Few things though that I have noticed,

    1) Is there any way that I can have the first page blank instead of it showing the first clients information.
    2) Is there a way that as I type, only the relevant matches dropdown. So if I type "Robin" only Robin in the name options show in the drop-down? I don't require the full list.
    3) Also, I notice that only Robin in the first name is showing, is there a way in the dropdown after Robin in the first name, Robin in the second name also shows?

    Are these possible? I don't know if what I'm saying makes sense

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Working on it, time restraints just now...

  7. #7
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Hi Dave,

    Please take your time. I'm also working on it by putting filters in the dropdown (Without any success ofcourse), but still tyring.

  8. #8
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Log in as usual. There's an entirely new form, frmClientDetails.
    Begin typing in the search textbox and the listbox below it will update with every keystroke.
    When you see the desired name in the listbox, click on it and that name's data will populate the form.
    It's a really nice technique that I found online years ago and can't remember where, but I was able to adapt it for your DB requirements.

    Renamed table keys and links as _PK and _FK.
    Set up table relationships with referential integrity.
    Added a tempvar for the user login name.
    Converted the switchboard macros to VBA.
    Last edited by davegri; 11-21-2018 at 12:43 AM. Reason: more

  9. #9
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    WOW Dave!!!! THis is amazing!!!!!! Thank you soooo much!!!!!!!! Brillliant!!!!

  10. #10
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    Hey Dave,

    First off, your file and suggestions have been of tremendous help. I have replicated everything that you did into my dummy database.

    But, I am getting stuck in one area. I feel it can be easily fixed, but every time I try to refigure with a code something or the other goes wrong...

    a) When I login in as "admin" (password is "123") - Everything is working brilliantly! except when I first open the Client Details form, and I click a name in the drop-down list. It says could not locate. But once the client details are loaded (using the blue search button), then the drop-down list works perfectly.
    Is there any way I can get the drop-down list to work from the time the form loads?

    b) When I login in as "user" (password is "123") - Here the drop-down list does not load, also the reset button doesn't work. I can't seem to get around this.

    In User my settings are
    Me.AllowAdditions = True
    Me.AllowEdits = False
    Me.AllowDeletions = False
    Me.DataEntry = True
    I don't understand why the drop-down list doesn't show.

    c)
    When I login in as "user2" (password is "123") - Here the everything is blank in the client details form. I know it would work if the form doesn't remain blank. It's there in the design view. But I can't get the form to load in the beginning.

    In User2 my settings are
    Me.AllowAdditions = False

    Me.AllowEdits = True
    Me.AllowDeletions = False
    Me.DataEntry = True

    Please let me know if there is something we can do.
    Attached Files Attached Files

  11. #11
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Client Database_davegri-v04.zip
    In your case STOP USING me.dataentry = true!!!! It presents the user with a BLANK FORM preset in new record format. The Switchboard WAS also doing that (no more).
    The attached DB goes through somewhat convoluted logic to get the form presentations and abilities that you require for the different users.
    I removed the new record button from the switchboard and moved it to the Client Details form.

  12. #12
    rubs34 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Posts
    22
    My bad!!!!
    Dave.. This is brillliantly perfect!!! You've put in a lot of effort!!!! Thanks!!!!

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

Similar Threads

  1. Google Style Search
    By JetMottoGURU in forum Forms
    Replies: 2
    Last Post: 03-02-2018, 05:18 PM
  2. Replies: 0
    Last Post: 06-02-2016, 11:41 AM
  3. Google Search Terms Needed
    By hrenee in forum Reports
    Replies: 4
    Last Post: 09-25-2013, 02:38 PM
  4. Replies: 4
    Last Post: 05-29-2012, 01:32 PM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 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