Results 1 to 5 of 5
  1. #1
    Sreedhart is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    6

    Display data from Query into Form

    Hi,

    I am quite new to Forms and equally novice to this Forum also. I am attaching the database dbtest.zip which contains a table, couple of queries and form.

    I have done what ever settings I could after going thru some tutorials / discussion forums online, but to no avail.

    All that I want is, when I open the form "frmtest" in "form view", and select CS in Combo 8, the corresponding fields in the form viz Item name, Sl No and System Name should get updated on the form. I want to view it in "Single Form" format.

    I am not sure what else can go wrong here.
    Kindly help
    Regards.
    Attached Files Attached Files

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Here's a short tutorial on using the Combobox to retrieve Records:

    If you haven't already done so, create a Form based on your Table or Query, including all the Fields you want displayed.

    Then simply:

    • Add a Combobox to your Form.
    • The Combobox Wizard will pop up
    • Select "Find a record based on the value I selected in my combobox."
    • From the Table or Query the Form is based on, click on the Field you're searching by (a Field that is unique for each Record) to move it to the right side.
    • Hit Next.
    • Size the column appropriately.
    • Hit Next.
    • Name the Combobox something appropriate.
    • Hit Finish.

    Now you can drop the Combobox down and scroll down to the item to search by, or you can start to enter the item, and the Combobox will "autofill" as you type. Hit <Enter> and the Record will be retrieved.


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Sreedhart is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    6
    Hi, I have tried following the steps you have written but still not much of help. Will appreciate if you do the necessary changes in the attached .zip file and send me back.

    Many Thanks.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    1. tbltest does not have a single primary key field. All three fields are necessary to distinguish a unique record. This is a compound key. All three values will be needed to find specific record.

    2. Combobox RowSource is a GROUP BY query. Cannot use this to search and filter for a specific record in tbltest. It can be used to filter for all records that are 'CS' or 'GS'.

    Filtering can be done by parameterized query: http://datapigtechnologies.com/flash...tomfilter.html
    This is the approach you have attempted. You are missing the VBA code in combobox AfterUpdate event to requery the form. Follow the referenced tutorial.

    or

    by setting form filter property or by moving to a record. Can allow wizard to build code for this approach. linq's post describes that.
    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
    Sreedhart is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    6

    Display data from Query into Form

    Hi, Thank you very much. It is working. the biggest mistake I was doing was to attach to the "control source" of the combo instead of "row source". Couple of other pointers were also quite helpful. For those who may face a similar kind of problem find attached the modified db.
    Attached Files Attached Files

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

Similar Threads

  1. Display only sequential query data?
    By Kylester in forum Queries
    Replies: 3
    Last Post: 11-08-2012, 07:45 PM
  2. Form Data Display
    By mraxl in forum Forms
    Replies: 2
    Last Post: 08-06-2011, 07:37 PM
  3. Form won't display all data
    By cbwestrunner in forum Access
    Replies: 3
    Last Post: 06-09-2010, 03:10 PM
  4. Replies: 8
    Last Post: 10-09-2009, 10:12 AM
  5. Replies: 6
    Last Post: 02-20-2009, 11:50 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