kengooch
Member
- Local time
- Today, 12:20
- Joined
- Feb 29, 2012
- Messages
- 137
I have a form that has 2 unbound text boxes in which I enter vDateSt and the other one vDateEnd I also have a third combobox that looks up the last name of a Pathologist vGetPatho. I have a report that is designed to show all records between the two above dates and the select Pathologist. I have the following code
When I run this, it pops up a box and asks me for the value for vGetPatho, which is the item selected in the Drop Down Combo Box. If I type in the name of the Pathologist that I selected in the box, the report pops right up perfectly. So somehow the vGetPatho value is not getting assigned. I'm wondering if it is because it is a combo box and the bound value is not the last name but rather a numeric unique key.
Any suggestions?
Code:
DoCmd.OpenReport "rAccLogComplete", acViewReport, WhereCondition:="[tDateAcc] >= #" & Format(vDateSt, "yyyy-mm-dd") & "# AND [tDateAcc] <= #" & Format(vDateEnd, "yyyy-mm-dd") & "# And [vGetPatho] = [tPathLstNm]"
When I run this, it pops up a box and asks me for the value for vGetPatho, which is the item selected in the Drop Down Combo Box. If I type in the name of the Pathologist that I selected in the box, the report pops right up perfectly. So somehow the vGetPatho value is not getting assigned. I'm wondering if it is because it is a combo box and the bound value is not the last name but rather a numeric unique key.
Any suggestions?