Results 1 to 7 of 7
  1. #1
    qwerty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    91

    Creating an action button

    I am a beginner at Microsoft Access.



    I just have tables setup, one issue is that a field within table has number and texts. It's either a number and if no number it is N/A. Then 2 field has yes or no text. Access would not accept this input if I put integers or yes/no option. Right now all fields are showing short text. How do I fix this, without changing the data?


    1. Want to be able to create 2 buttons, that display to results in a list.

    2. The list will give several options to choose the location.

    3. After choosing the location it will take you to new page to input values.

    How do you do this?
    Last edited by qwerty; 10-20-2018 at 01:26 PM. Reason: Add more information

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not sure why you need two buttons.

    Use a combobox or listbox to list locations. Code in box AfterUpdate or button Click event can apply filter or can 'go to' record on same form. For a filter approach, review http://allenbrowne.com/ser-62.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.

  3. #3
    qwerty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    91
    Quote Originally Posted by June7 View Post
    Not sure why you need two buttons.

    Use a combobox or listbox to list locations. Code in box AfterUpdate or button Click event can apply filter or can 'go to' record on same form. For a filter approach, review http://allenbrowne.com/ser-62.html
    Thank you for response, that article is searching for records. I am creating 2 buttons. For example western us and eastern us buttons will display a list of states in either region. You select California input some information such as client name, rainfall, elevation, and then it will display a list plants that meets the plant specifications for that area in California.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    So you want code that modifies the combobox RowSource? This is called cascading or dependent combobox - a very common topic. Usually a value is selected in a combobox that controls what is displayed in a second combobox but I suppose two buttons could do the same thing a combobox with a two-item list could do.
    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
    qwerty is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    91
    Quote Originally Posted by June7 View Post
    So you want code that modifies the combobox RowSource? This is called cascading or dependent combobox - a very common topic. Usually a value is selected in a combobox that controls what is displayed in a second combobox but I suppose two buttons could do the same thing a combobox with a two-item list could do.
    How do I filter the list, right now it is showing all 50 locations in the list box from the table with all 50 locations. I just want it showing specific locations.

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Show us an image of your form so that we can better understand your requirement...

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    There are many examples of code for 'cascading' combobox (or listbox). Since you want to use buttons, code in click event can be like:

    Me.lboLocations.RowSource = "SELECT LocationNames FROM Locations WHERE Region = 'western';"
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 10-07-2018, 05:24 PM
  2. Replies: 2
    Last Post: 01-11-2015, 11:45 PM
  3. Button action depending on combobox value
    By Mattbro in forum Programming
    Replies: 3
    Last Post: 03-20-2014, 08:36 AM
  4. Changing Action on a Command Button
    By ETCallHome in forum Forms
    Replies: 5
    Last Post: 03-14-2011, 05:53 AM
  5. No action button
    By dlewicki in forum Forms
    Replies: 6
    Last Post: 12-02-2009, 12:58 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