If you are asking about how to *sanitize* the input from the inputbox,
then there could be a lot of ways depending on the level of security
you need. You'll need to be more specific than that.

As an aside, I think the better way to find the Index of a DataRow in
a DataTable is :

(Typed in here, watch for syntax)
---
Dim pos as Integer = -1
'Assumes that the "id" column is set as the Primary Key of the
DataTable.
Dim dr as DataRow = DataSet11.Table1.Find("4")
If dr isnot nothing then
  pos = DataSet11.Table1.Rows.IndexOf(dr)
  Me.BindingContext(DataSet11, "table1").Position = pos
End If
---



On Jun 21, 10:11 am, anubhav nidaria <[email protected]> wrote:
> i hv an access database "employee" having table "table1". i take a variable
> a, now whn i enter a=4, i want d record where "id" column consists 4 shud
> get displayed......datatype of id column is autonumber, this is d code:
>
> Dim a AsInteger
>
> Dim b AsInteger
>
> Dim c AsInteger
>
> Dim d AsInteger
>
> b = 0
>
> d = 1
>
> a = InputBox("abc", "xyz")
>
> Me.BindingContext(DataSet11, "table1").Position = 0
>
> c = Val(DataSet11.Table1.Count)
>
> DoWhile d <= c
>
> If Fix(DataSet11.Table1.idColumn) <> a Then
>
> Me.BindingContext(DataSet11, "table1").Position =
> Me.BindingContext(DataSet11, "table1").Position + 1
>
> Else
>
> b = 1
>
> ExitDo
>
> EndIf
>
> d = d + 1
>
> Loop
>
> If b = 0 Then
>
> MsgBox("Employee number does not exist")
>
> EndIf
>
> wht shud i put in d braces of fix function,do i even need to use any
> function, I m using textboxes to display data?

Reply via email to