I have bindingsource.find problem - hopefully someone has thoughts as to why it is not working. Here is the code:
Private Sub WriteDateAddedData(ByVal NewRecordScottNumber As Object)
StampCollectionTableAdapter1.Fill(SCDBDataDataSet1.StampCollection)
StampCollectionBindingSource1.MoveFirst()
StampCollectionBindingSource1.Position = StampCollectionBindingSource1.Find("ScottIndex", NewRecordScottNumber)
MsgBox(StampCollectionBindingSource1.Position.ToString)
CType(Me.StampCollectionBindingSource1.Current.Row, SCDBDataDataSet1.StampCollectionRow).DateAddedToDB = Date.Today
StampCollectionBindingSource1.EndEdit()
TableAdapterManager1.UpdateAll(SCDBDataDataSet1)
End SubIn the code above, the sub is called an passed a string to look for. The find - in this case incorrectly sets the position to 0 and writes the data there.
If I manually put in the object to search for in the find as in:
StampCollectionBindingSource1.Position = StampCollectionBindingSource1.Find("ScottIndex", "Aruba3")This works perfectly - it finds the proper row and writes the data.
I have tried to TRIM the variable (it's already trimmed when passed anyway) - did not work.
I have tried to define the inbound variable as string - did not work.
I have tried to place a single quote mark around the data - did not work.
Yes - the field "ScottIndex" is defined as the primary key for the bindingsource.
Any thoughts???
Thanks,
Roger