skwilliams
Registered User.
- Local time
- Yesterday, 19:07
- Joined
- Jan 18, 2002
- Messages
- 516
I have a form where I select a date from an unbound combo box (Combo80). * This is a list of week ending dates. When a date is selected I need Text16 to fill with the total for that date from qryOCParts1.
Here's sample data from the table referenced.
SumOfCount EndOfWeek
3644 3/31/2012
6959 3/24/2012
7488 3/17/2012
7163 3/10/2012
6888 3/3/2012
Result should be "If I select 3/24/2012, Text16 fills with 6959.
Here's the VBA code.
Here's my problem, I keep getting this error.
Run-time error '2471':
The expression you entered as a query parameter produced this error:
'WkEnd'
Here's sample data from the table referenced.
SumOfCount EndOfWeek
3644 3/31/2012
6959 3/24/2012
7488 3/17/2012
7163 3/10/2012
6888 3/3/2012
Result should be "If I select 3/24/2012, Text16 fills with 6959.
Here's the VBA code.
Code:
Private Sub Combo80_AfterUpdate()
Dim WkEnd As Date
Dim Yr As Integer
Dim PvsDate As Date
WkEnd = Combo80.Column(0)
Yr = Combo80.Column(1)
PvsDate = Combo80.Column(2)
Text16 = DLookup("[SumOfCount]", "qryOCParts1", "EndOfWeek=WkEnd")
End Sub
Here's my problem, I keep getting this error.
Run-time error '2471':
The expression you entered as a query parameter produced this error:
'WkEnd'
