Results 1 to 3 of 3
  1. #1
    akhlaq768 is offline Novice
    Windows 2K Access 2002
    Join Date
    Feb 2012
    Posts
    14

    Command button to populate subform

    I have created a textbox that would allow the user to enter the staff id.
    I have also created a query that will search the dataset and return the appropriate columns based on the criteria in the query.



    Need help in creating a command button that will run my query based on the entry of the staff if and then populate the subform

    If you require any further information or clarification on anything, please shout.

    Thanks in advance
    Last edited by akhlaq768; 02-07-2012 at 04:57 AM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Don't need to 'run' the query, you should requery the subform. Code: Me.[Query1 subform].Requery

    Could make the textbox a combobox and limit user entry to item from list. Also, instead of the criteria in query, can use the Master/Child links of subform container control. Set Master link to the combobox, Child link to Indentifier.

    If you stick with the textbox and parameter in query, need wildcard with the LIKE operator: LIKE "*" & Forms!Form1!Search & "*"
    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
    akhlaq768 is offline Novice
    Windows 2K Access 2002
    Join Date
    Feb 2012
    Posts
    14
    thanks... perfect

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

Similar Threads

  1. Replies: 3
    Last Post: 10-17-2011, 01:13 PM
  2. Populate text boxes with a command button
    By Brian62 in forum Forms
    Replies: 3
    Last Post: 09-30-2011, 12:52 PM
  3. Command Button Problem is Subform
    By Lupson2011 in forum Access
    Replies: 3
    Last Post: 08-25-2011, 08:39 AM
  4. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 PM
  5. Open a linked subform with a command button
    By flablueeyedblond in forum Forms
    Replies: 0
    Last Post: 11-18-2005, 01:18 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