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????
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,
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???
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.
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.