Results 1 to 8 of 8
  1. #1
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50

    run query at runtime

    Hi,



    I have a combox with list of deptnames. By selecting the dept corresponding employeenames display in the listbox. by selecting the employeename, i want to display the employee details in the corresponding textboxes. how?

    i have tried the query, after selecting employee name, that employee name only display in the corresponding textbox. not other fields.

    when i check the query it will get all details, after selection of listbox employee names.

    Please help me.

    Regards,
    Sireesha.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    Quote Originally Posted by pbaldy View Post
    Hi,

    Thanks for your reply. but in my listbox only employeenames. when i select employee name their details will display in correponding textboxes.
    i tried with query passing parameter from listbox to query. after selection of listbox employeename the query gives result(i.e., empid,desg,phoneno,address etc.,). but how to connect textboxes to that query.

    i've tried like this also :

    Forms---> controlsource ==queryname and textboxes bound to queryfields. but its not worked.

    how?

    Please help me.

    Regards,
    Sireesha.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Well, your listbox could have more than names, could it not?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    Quote Originally Posted by pbaldy View Post
    Well, your listbox could have more than names, could it not?
    Hi,

    my listbox have only names. when i select name, those details need to be displayed in corresponding textboxes. how?

    Regards,
    Sireesha.

  6. #6
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Hi Sireesha,
    Try writing expression for it in the expression builder.

  7. #7
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50

    check my query

    Quote Originally Posted by pradeep.sands View Post
    Hi Sireesha,
    Try writing expression for it in the expression builder.

    SELECT *
    FROM [table]
    WHERE ((([table].[Name])=[Forms]![form1]![Name]));


    [Forms]![form1]![Name] means in the form---> listbox--->have names

    when is select listbox name---> all other textboxes are blank and name textbox will replace with selecting name.

    i need all other textboxes need to replace with further details

    Regards,
    Sireesha.

  8. #8
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Open your sql as a recordset so that you can move through each field and record, and try to assign each field value to the respective text box..
    nametxtbox = Me.Fields(0).Value
    addresstxtbox = Me.Fields(1).Value
    ...
    ...

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

Similar Threads

  1. Updateable query failing in Runtime - 2010
    By ChefContainer in forum Queries
    Replies: 1
    Last Post: 02-05-2013, 07:29 PM
  2. RunTime Error 3075 in my query
    By burrina in forum Queries
    Replies: 10
    Last Post: 01-07-2013, 08:23 PM
  3. Replies: 6
    Last Post: 09-20-2012, 04:22 PM
  4. Replies: 16
    Last Post: 06-18-2012, 02:27 PM
  5. Replies: 13
    Last Post: 06-12-2012, 09:52 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