Results 1 to 2 of 2
  1. #1
    Psyclone is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    7

    Query by Form

    I want to use a form to search and return values from a query. I don't want the form to edit/change any of the values in the query though. From what I've read, I want to make a Query by Form (QbF).

    I have a query (named 2010 Recap) with about 15 different fields so far, including PlayerName, City, State, StrokeAverage, Cash.



    I also have a ComboBox on the form that has all of the PlayerNames. What I'd like to do is make a Label or TextBox display some of the other fields from the same query (2010 Recap), preferably a Label, based on the PlayerName selected in the ComboBox.

    How do I do this? Do I have to create an event or a macro using Visual Basic? If so, can you point me in the right direction please?

    I have a little experience with Visual Basic and a fair amount of experience with Flash, C++ and MatLab programming languages.

    Any help would be greatly appreciated. Thanks in advance.

  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I'm not completely sure what you're looking for....but if you want to assign the value to a label based on your combobox selection, you can use as follows (assign to combobox after-update property):

    Private Sub Combo28_AfterUpdate()
    Me.someLabel1.caption = Me.Combo28.Column(0)
    Me.someLabel1.caption = Me.Combo28.Column(1)
    Me.someLabel2.caption = Me.Combo28.Column(2)
    End Sub

    Just add the fields you want to the rowsource of your combobox. You can make them invisible by setting the column width to 0.

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

Similar Threads

  1. Query to only show a value in a form from a query
    By cwwaicw311 in forum Queries
    Replies: 28
    Last Post: 03-27-2010, 02:31 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