Results 1 to 9 of 9
  1. #1
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117

    Enter Key Behavior

    Hello,

    I have a form with a tab control, with 4 tabs.
    The function of this form is to be a search box.
    Selecting one tab displays a search box to search by manufacturer, another tab to search by product name, etc.

    The activate the search there is a 'Search' button. There is one button for each tab.


    How can I set the enter key to trigger this button?
    When I had only set up one of the tabs and set the search button's default property to Yes, it worked very well.
    However, now that I have four tabs with a total of 4 search buttons it behaves...erratically.

    Any and all help is appreciated.

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    All the "Search" buttons are on the same form, even though they are in different tabs, so only ONE of them at a time can have the Default property set to "Yes".

    You might be able to put code in each tab (maybe in a "Got Focus" event ) to set its search button's default property to "Yes", which will set the others to "No" automatically.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Inquiring minds just have to know...WHY would you have a different Tabbed Page for each search box?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I agree - the tab control seems unnecessary and confusing.

    Are you using a dynamic parameterized query? I never do that. Review: http://www.allenbrowne.com/ser-62code.html
    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.

  5. #5
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Quote Originally Posted by Missinglinq View Post
    Inquiring minds just have to know...WHY would you have a different Tabbed Page for each search box?

    Linq ;0)>
    3 Reasons:

    1) I quote the words of one of the supervisors who will use this database, "I like tabs, why can't our search just be a tab for this search, or a tab for that search."
    2) 6 months ago I had never used access, I'm learning quickly, but 6 months is 6 months.
    3) Working on access is not what I was hired to do, I am a compliance guy, I put together one bare-bones access database to help me organize some regs and the next thing I know the bosses have me making db's for everyone else and I'm trying to figure out how to get things to work in a semi-stable manner, while still leaving me with enough time to do my job.

    So yeah...that is pretty much the 3 reasons.
    I have attached the database as it sits now so you all can see what I'm doing in context. I recognize it probably is really underwhelming, but as I said 6 months ago I didn't know a form from a query so please be gentle.

    June7, appreciate the link, have not had time to really run through it and see if I understand it yet.
    Although it looks like an elegant solution.
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You have learned a lot! Looks like a good start.

    Review this link for method to emulate 'tabs' http://www.datapigtechnologies.com/f...loredtabs.html

    The API functions declared in emgBypass will cause error in some computers - as it did when I opened the db. Review http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

    I don't use API calls to get computer and user information. I use Environ() function. http://msdn.microsoft.com/en-us/libr...ffice.15).aspx

    Environ("USERNAME") will retrieve the network username of user logged-in on the computer.

    The 3 login forms are almost identical except for caption of one button. Think I would make one form serve and use code to modify caption as appropriate for the situation.
    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.

  7. #7
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Quote Originally Posted by June7 View Post
    You have learned a lot! Looks like a good start.
    Thank you, appreciate it.

    Review this link for method to emulate 'tabs' http://www.datapigtechnologies.com/f...loredtabs.html
    Ohh, I like this. No more difficult than the jerry-rigging I have right now with the blank rectangles to cover the subform prior to search.


    The API functions declared in emgBypass will cause error in some computers - as it did when I opened the db. Review http://msdn.microsoft.com/en-us/libr...ffice.15).aspx
    Right, I too received those errors when I tried to open my attachement... I'm not sure why I got them when opening from the attachment but not when I open my regular copy...of course, to be honest I don't understand most of what is in that module. I just wanted a way to password mask an inputbox and found that code online, copy + paste and it is as it is now.


    I don't use API calls to get computer and user information. I use Environ() function. http://msdn.microsoft.com/en-us/libr...ffice.15).aspx
    Ohhhhh, so if I understand your link right, adding the PtrSafe keyword to all declare functions would (theoretically) allow for usage in 64 bit systems?

    Environ("USERNAME") will retrieve the network username of user logged-in on the computer.
    Right, recently discovered this, while searching for a method to create an audit trail.
    You probably noticed the basic audit functionality, to be honest I don't anticipate a need for it in this database, but my primary reg database (the barebones db mentioned in my previous post) could really use it so I am toying with it while I get this db set up.

    The 3 login forms are almost identical except for caption of one button. Think I would make one form serve and use code to modify caption as appropriate for the situation.
    Exactly right, I made a couple of copies of that form in case I decided I needed multiple logins. Right now it looks like I will only end up using one so the other 2 will most likely be deleted shortly. I try and keep an extra copy of forms I toy with a lot. The code to control user access I came up with largely by trial and error, so I definitely wanted a spare form in case I really messed something up.

    Thanks for pointing me in the right directions!

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I think password hashing can be done with InputMask property in field set up in table. But I've never built password control into database. If user can log into network, I accept that they are valid user. The db is split and front end is placed only on valid user workstations. Backend folder on server has permission control.
    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.

  9. #9
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Quote Originally Posted by June7 View Post
    I think password hashing can be done with InputMask property in field set up in table. But I've never built password control into database. If user can log into network, I accept that they are valid user. The db is split and front end is placed only on valid user workstations. Backend folder on server has permission control.
    Right, on a form and in the table itself the inputmask works, but apparently it takes a lot of code to get an inputBox to have an inputMask.
    Db splitting is something I am looking into, for the time being the password control is due to all DB's are required to be stored on a shared drive and anyone with a computer in the company can access them freely. So I am just trying to keep some semblance of data integrity.

    I'm going to go ahead and mark this solved, thanks again for the assist.

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

Similar Threads

  1. Field auto enter new line on enter event
    By Ruegen in forum Forms
    Replies: 3
    Last Post: 09-17-2013, 09:00 PM
  2. Odd behavior when hitting "enter"
    By premis in forum Forms
    Replies: 2
    Last Post: 03-29-2013, 01:10 PM
  3. "Enter Key Behavior" weirdness
    By EvanRosenlieb in forum Forms
    Replies: 1
    Last Post: 06-27-2011, 05:15 PM
  4. Behavior of the "Enter" key on textbox
    By Grooz13 in forum Forms
    Replies: 1
    Last Post: 01-13-2011, 03:00 PM
  5. MS Access Enter Key Behavior
    By RAPSR in forum Programming
    Replies: 0
    Last Post: 12-23-2007, 02:31 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