Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18

    Unanswered: Combo Box Issues

    Hello all,

    Currently I have a small problem. I have a combo box runs on a query and pulls back a last and first name. I then have a button with a macro behind it that says to run a report where the last name selected in the combo box is = the last name in the table...and give me the report in print preview. Right now the values are populated in the combo box but I am unable to select anything. I'm not sure what is wrong??? Can anyone point me in the right direction??? Here is the what I am using:

    In the on click event property for the button the macro is named and in the where condition of the macro I have:
    [Forms]![Report Choices Form]![Combo27]=[2004 Employee Summary Query]![Name_Ident]

    So if the combo box is pulling the values based on the query, why can I not select a value....I assume that once this is resolved the button will perform correctly????

    Any help is greatly appreciated!

    Thank You,
    Mike
    Mike R.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Is the combo box bound to something?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    The combo box is bound to the 1st column in the query, which is Name_Ident. I wanted to have Last_Name and First_Name in the combo box but was unsure how to tie that into the macro which has the where condition where I only want to select on the Last_Name from the combo box. Right now, I can't figure out why I am unable to even select from the combo box?

    Thanks for your help as always, I know this is a rookie mistake,
    Mike
    Mike R.

  4. #4
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    How comfortable are you with VBA because this could be solved by getting rid of those macros and using a few VBA snippets.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  5. #5
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    not very familiar....not enough to write it for this problem, I know it's better but i'm just not very familiar with it. Would I just need something behind the On click procedure??? Right now I can't even select from the combo box, very weird to me, never had this problem???

    Thanks again,
    Mike
    Mike R.

  6. #6
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    I would actually make you put some sql in the record source of the combo (get rid of the selection problem) then take the value of that and use it in the onclick behind the button.

    It's not that hard... (do you need it to store what person is selected?) or is that combo box more of a way to just print that persons report?

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  7. #7
    Join Date
    Aug 2003
    Posts
    68
    Controlname.RowSource = ("SELECT distinct [Table].[FIELD] FROM Table;")



    Just real simply us a row source selection like the above for the field you need stored.
    jm

  8. #8
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    The combo box selection is simply to be able to print that person's report, no need to store the value anywhere.

    Thanks,
    Mike
    Mike R.

  9. #9
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Okay that makes it a bit easier.

    I am not quite sure how to attack this... Your button looks like we dont need to mess with it.

    What we need to do is set the recordsource for your combo box on the open of the form that way you dont have to tie it to a query. (Unless you need it tied to a query for some reason).

    What would you prefer... just setting the recordsource for the combo box through VBA, or through the properties of the combo box... I would assume through the properties.

    Now we need to know what you need the recordsource to be.

    Let me know...
    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  10. #10
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    We can just set it through the properties, would be easier I assume until I get some more VBA under my belt. Should I just remove the query from the row source and place in something like this in the row source property of the combo box?

    SELECT DISTINCT [2004Employee].[Name_Ident] FROM 2004Employee;

    Is this what I need there?

    Thank you for all of your help in what i'm sure is something very minor to you.

    Mike
    Mike R.

  11. #11
    Join Date
    Aug 2003
    Posts
    68
    Thats it.. That should do what you need. Make sure that your combo box lock property is not on.
    jm

  12. #12
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    Well, I tried that exact line of code in that row source property:
    SELECT DISTINCT [2004Employee].[Name_Ident] FROM 2004Employee;

    and in the form_load event:
    Combo27.RowSource = ("SELECT distinct [2004Employee].[Name_Ident] FROM 2004Employee;")

    I receive the value for the combo box and the lock property is set to no...but I am still unable to choose a value from the combo box????
    Mike R.

  13. #13
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Why don't you just make this easier.

    Make the command button simply open your report, nothing else.

    Make the combo list, just display the two columns you want, nothing else.

    In the query behind the report, under Person ID put the following condition

    =[Forms]![Reports Choice Form]![Combo0]

    See the attached for an example.
    Attached Files Attached Files

  14. #14
    Join Date
    Apr 2004
    Location
    Kansas City
    Posts
    18
    I have my db setup exactly as in your zip file but for some reason still unable to select from the combo box???? Not sure what is going on??

    Thanks,
    Mike
    Mike R.

  15. #15
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    Is it not possible for you to attach your database so that I could fix it for you?

    If not, what I suggest you do, is to delete the current button and combo box and restart this procedure from the start. and delete any VB codes that are linked to these items.

    Firts modify your query so that in the ID field you have this:

    =[Forms]![Reports Choice Form]![Combo0] *or what ever you have called your combo.

    Secondly, create your button to open the specified report.

    Third, add a new combo list and use the wizard to select the fields you require.

    This should work. If it doesn't, I really suggest you stick your database on here for a quick fix. One question that I do have, is that is the form Reports Choice Form the only form that you run that report from? If it's not, you'd best solve it using Global codes but it's not really important if you only run it from one location.

    Regards, Christy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •