Results 1 to 8 of 8
  1. #1
    cadmaster is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    8

    Please help me how to program the search button...

    Hi,
    Could someone please help me to program the search button so they can return and says, enter is invalid?


    Please see attached image.
    Thanks
    Attached Thumbnails Attached Thumbnails 12-5-2013 9-50-21 PM.jpg   12-5-2013 9-41-37 PM.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why don't you use a combobox?
    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.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    In the VBA behind your button, you can use DCOUNT (for example) to detect whether the entry exists in the table, then issue a cancel or error message.

  4. #4
    cadmaster is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    8
    Hi Dal Jeanis,
    Could you please show me how? I am just a beginner.
    Thanks
    Phe

  5. #5
    cadmaster is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    8
    Hi June,
    How can I use combobox for this?
    Thanks

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    What June and Dal are eluding to is that the value of EDO is known. It is a value within a record that resides in a table. You can use the wizard to create a combo box and have the combo box look at the table where the field EDO is.

    You can use the dlookup function to lookup the value in this table.

    Letting the user type miscellaneous text into a control is asking for trouble. So, you are right, you need something to tell the user they are typing invalid data or you could provide them a list of options with a combo box or something.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    A combobox would give users a list of valid choices. If the combobox LimitToList property is set to yes then users can select only from the valid items.
    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.

  8. #8
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742

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

Similar Threads

  1. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  2. Replies: 12
    Last Post: 03-22-2012, 02:48 AM
  3. Search Button
    By bomber72 in forum Forms
    Replies: 6
    Last Post: 08-03-2011, 11:44 AM
  4. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 PM
  5. program find button to search whole table
    By sammer021486 in forum Programming
    Replies: 2
    Last Post: 10-01-2009, 06:36 AM

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