navigatting with keystrokes at a recordset

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
 
C

Chris Dunaway

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
 
G

giannis

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()
 
R

RobinS

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.
-----------------------------------------------
 
G

giannis

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 !!! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top