Results 1 to 4 of 4
  1. #1
    accesslessio is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2016
    Posts
    10

    Listbox value within a tabular layout update all records in the table

    Hi,


    I'm facing a problem: I have put within a tabular layout form a listbox with a few names. When I use the form and I select a name all the listbox in the rows of the form show me the value I have chosen. How can I make the value I select just for its relative record?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by accesslessio View Post
    ...How can I make the value I select just for its relative record?
    I suspect you will need to use some VBA to adjust the form's recordsource. Is the ListBox Control capable of handling multiple selections or does it allow only one selection at a time?

  3. #3
    accesslessio is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Sep 2016
    Posts
    10
    Hi,
    no just one selection. It's for choosing the operator of a specific test. Each record represent a test (in a laboratory).

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Since the ListBox Control is not a MultiSelect, you can use the Value property to define the criteria for your form's RecordSource. You can concatenate the Value property of your ListBox to an SQL statemtn and assign that to your Form's RecordSource. The following is an example that would go in the ListBox Control's AfterUpdate Event.
    Code:
    Me.RecordSource = "SELECT * FROM TableOrQueryName WHERE [MyNumberField] = " & Me.ControlName.Value

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

Similar Threads

  1. Sorting records on a tabular form
    By Jen0dorf in forum Access
    Replies: 10
    Last Post: 12-12-2015, 08:29 AM
  2. Loop trough listbox to update table
    By mari_hitz in forum Programming
    Replies: 4
    Last Post: 04-21-2014, 07:16 AM
  3. Create Form with Tabs In Tabular Layout
    By zool.hilmi in forum Forms
    Replies: 1
    Last Post: 06-13-2012, 04:48 PM
  4. Update table with different layout
    By Deutz in forum Queries
    Replies: 2
    Last Post: 10-03-2011, 10:51 PM
  5. Replies: 6
    Last Post: 03-27-2010, 11:18 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