Results 1 to 6 of 6
  1. #1
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57

    fill form textboxes from users table

    I have a query:

    Code:
    SELECT Users.UserName, Users.Score
    FROM Users
    ORDER BY Users.Score DESC;
    Click image for larger version. 

Name:	Untitled.png 
Views:	7 
Size:	5.7 KB 
ID:	51924



    the table:

    Click image for larger version. 

Name:	Screenshot 2024-06-30 232010.png 
Views:	9 
Size:	6.4 KB 
ID:	51919

    The image:
    The textboxes (top for usernames and bottom for scores) how to get the values from the query? I want to put all usernames from the query into the textboxes and I want to get all the scores from the query to the textboxes as well but all in one go. How to do that?

    Click image for larger version. 

Name:	Screenshot 2024-06-30 232723.jpg 
Views:	9 
Size:	93.7 KB 
ID:	51920

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Use a query.
    Name the texboxes as txtWhateverEvernn where nn is a number, then allocate the query values and names to the respective textboxes.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57
    Quote Originally Posted by Welshgasman View Post
    Use a query.
    Name the texboxes as txtWhateverEvernn where nn is a number, then allocate the query values and names to the respective textboxes.
    I am really new to this, could you give an example or guide me with link tutorial to do that?

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    No, sorry. I just am just mentioning the method I would use.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    rwahdan1978 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Jun 2024
    Posts
    57
    Quote Originally Posted by Welshgasman View Post
    No, sorry. I just am just mentioning the method I would use.
    I made this query that will sort them from largest to smallest. How to use the query to fill the textboxes?

    Code:
    SELECT Users.UserName, Users.Score
    FROM Users
    ORDER BY Users.Score DESC;

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,574
    Use that query as your recordset, read that and set the various controls/labels keeping count of the record number.
    That is why I said the controls have to have a numeric portion, so you can tie each to their respective control.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Fill Textboxes
    By Eranka in forum Access
    Replies: 5
    Last Post: 10-28-2019, 08:23 AM
  2. Replies: 19
    Last Post: 01-30-2019, 08:21 PM
  3. two textboxes in form to one cell in table
    By WickidWe in forum Forms
    Replies: 2
    Last Post: 12-12-2013, 05:25 PM
  4. Auto fill Txtbox with logged in Users Name
    By pfales in forum Access
    Replies: 3
    Last Post: 04-30-2013, 01:22 PM
  5. Replies: 0
    Last Post: 06-29-2011, 01:04 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