EOF

Z

-z

I use A2K

===========

How do I stop at the lst rec and go no farther when using a cmdBtn to do a
"next rec"

Thank you...
 
C

Cheryl Fischer

You can insert the following code into your Form's On Current event:

Me.RecordsetClone.MoveLast
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = Not Me.CurrentRecord = Me.RecordsetClone.RecordCount

When at the first record in the recordset, the command button to
MovePrevious (cmdPrevious) will be disabled. When on the last record in
the recordset, the MoveNext button (cmdNext) will be disabled.

hth,
 
Z

-z

Thank you

Could you do this:

I am writing myself a "flash" or "Flip" card prog

I have cmdFlip "flipping" my "card": first click makes visible the term in
the txtTerm box -- the next click makes txtDefin show

What you have certainly does what I want in the code "knowing" the eof has
been reached

What I would like is to be able for the cboSelectCategory to be servicible
in that the User can begin again:

Private Sub cboSelectCategory_AfterUpdate()
'My qryTerms has a Category, so I can select, say, Latin vocab
'or whatever Terms/Defin I desire

Me.Filter = "[Cat]='" & cboSelectCategory & "'"
Me.FilterOn = True
DoCmd.Requery

lblPressFlipBtn.Visible = True
lblSelection.Visible = False
End Sub
 
C

Cheryl Fischer

I think I would change:

DoCmd.Requery

to

Me.Requery


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


-z said:
Thank you

Could you do this:

I am writing myself a "flash" or "Flip" card prog

I have cmdFlip "flipping" my "card": first click makes visible the term in
the txtTerm box -- the next click makes txtDefin show

What you have certainly does what I want in the code "knowing" the eof has
been reached

What I would like is to be able for the cboSelectCategory to be servicible
in that the User can begin again:

Private Sub cboSelectCategory_AfterUpdate()
'My qryTerms has a Category, so I can select, say, Latin vocab
'or whatever Terms/Defin I desire

Me.Filter = "[Cat]='" & cboSelectCategory & "'"
Me.FilterOn = True
DoCmd.Requery

lblPressFlipBtn.Visible = True
lblSelection.Visible = False
End Sub

Cheryl Fischer said:
You can insert the following code into your Form's On Current event:

Me.RecordsetClone.MoveLast
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = Not Me.CurrentRecord = Me.RecordsetClone.RecordCount

When at the first record in the recordset, the command button to
MovePrevious (cmdPrevious) will be disabled. When on the last record in
the recordset, the MoveNext button (cmdNext) will be disabled.

hth,
do
 
Z

-z

Thank you...

It's always something...

Cheryl Fischer said:
I think I would change:

DoCmd.Requery

to

Me.Requery


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


-z said:
Thank you

Could you do this:

I am writing myself a "flash" or "Flip" card prog

I have cmdFlip "flipping" my "card": first click makes visible the term in
the txtTerm box -- the next click makes txtDefin show

What you have certainly does what I want in the code "knowing" the eof has
been reached

What I would like is to be able for the cboSelectCategory to be servicible
in that the User can begin again:

Private Sub cboSelectCategory_AfterUpdate()
'My qryTerms has a Category, so I can select, say, Latin vocab
'or whatever Terms/Defin I desire

Me.Filter = "[Cat]='" & cboSelectCategory & "'"
Me.FilterOn = True
DoCmd.Requery

lblPressFlipBtn.Visible = True
lblSelection.Visible = False
End Sub

Cheryl Fischer said:
You can insert the following code into your Form's On Current event:

Me.RecordsetClone.MoveLast
cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = Not Me.CurrentRecord = Me.RecordsetClone.RecordCount

When at the first record in the recordset, the command button to
MovePrevious (cmdPrevious) will be disabled. When on the last record in
the recordset, the MoveNext button (cmdNext) will be disabled.

hth,
--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


I use A2K

===========

How do I stop at the lst rec and go no farther when using a cmdBtn
to
 

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