Thank You for you assistance but it did not work, I received an invalid cast
exception.
I am sorting the Dataview on two columns, I believe this is why it is
requiring two arguments for the sort. But when I try to give the Find to
arguments it underlines it.
I am sorting as such:
ADataView = New DataView(ADataset.Tables("Temp"))
ADataView.sort = "Date, Shift"
If I do not sort and Date and Shift It works just fine Finding the Date:
X = ADataview.Find(TheDate)
It's the 2 parameters that is giving me the problem.
Chuck
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,
You need to enclose the date in #. Try this.
Dim Names(1) as String
Name(0) = string.format("#{0}#",TheDate)
Name(1) = txtShiftNumber.text
X = ADataView.Find(Names)
Ken
-------------------
"Charles A. Lackman" <Ch*****@CreateItSoftware.net> wrote in message
news:OE****************@TK2MSFTNGP12.phx.gbl...
Hello
I have created a Dataview and have sorted it on the Date and ShiftNumber
columns
this works great, but when I want to use the Find Method it gives me the
following error:
Expecting 2 value(s) for the key being indexed, but received 1 value(s).
I have tried the following:
Dim Names(1) as Object
Name(0) = TheDate
Name(1) = txtShiftNumber.text
X = ADataView.Find(Names)
and
X = ADataview.Find(TheDate)
Any assistance will be greatly appeciated.
Thank,
Chuck