navigatting with keystrokes at a recordset

  • Thread starter Thread starter giannis
  • Start date Start date
G

giannis

I want to write a code so the fields of my form go to the next record
when i press the PgDn key.
What must i write ?

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
Handles Me.KeyDown

If e.KeyCode = Keys.PageDown Then

----------------> ?


End If

End Sub
 
I want to write a code so the fields of my form go to the next record
when i press the PgDn key.
What must i write ?

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
Handles Me.KeyDown

If e.KeyCode = Keys.PageDown Then

----------------> ?

End If

End Sub

Why don't you give us a little hint! How are you retrieving your
data? In what structure is it stored? Is it a Recordset or a
DataReader? Are your rows in a List<>? How are they represented on
your form? Using Labels? TextBoxes?

For a Recordset, you would the call the MoveNext method to have it
move to the next record. For a DataReader, you would just call the
Read method to get the next item.

You have not really provided enough information for us to help you.

Chris
 
Chris said:
Is it a Recordset or a DataReader?
recordset

How are they represented on your form? TextBoxes?
yes

For a Recordset, you would the call the MoveNext method to have it
move to the next record.

Is this correct ?
Me.TABLEBindingSource.MoveNext()
 
You mean dataset, right?

Either way, if you have your dataset and controls bound to
TableBindingSource, then TableBindingSource.MoveNext will, indeed, move you
through the records. The BindingSource has all kinds of nifty methods that
you can use (Find, Filter, etc.)

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
 
RobinS said:
Either way, if you have your dataset and controls bound to
TableBindingSource, then TableBindingSource.MoveNext will, indeed,
move you through the records. The BindingSource has all kinds of
nifty methods that you can use (Find, Filter, etc.)

Thank you very mutch !!! :)
 
Back
Top