Stop move past last record

  • Thread starter Thread starter anne_shaw
  • Start date Start date
A

anne_shaw

Guest
How do I stop a user going past the last record on the form when using the MoveNext key. I have put a warning in when the last record is reached but I can still go past.
 
Hello,

You had to build your own navigation buttons (with the wizard) and disable / enable them. If you can pop up a msgbox when the last record is on the form then you can easely disable the next button. (buttonname.enabled = false)

Greetings,

Albert
 
Would setting the AllowAdditions property to No do what you need?

David R
 
Finally worked out the reason for my dilema. I have put code behind all my required field so that the user must enter a value so they are not just hung when they do not complete all fields. I have disabled the move next button so they have to use the add new button to get to a blank record and enabled them again from other buttons but the problem is if they press the Add New button and then change their mind. How to get rid of the new record if they do not want it as it keeps jumping to a my validation and displaying error messages. (Which is of course correct).

Thanks for all the reples.

Anne
 
You could do something like:

If IsNull (Me.AutonumberField) or Me.AutonumberField = 0 Then
DoCmd.Close (or whatever)
Exit Sub
End If

That way, if it's a new record that the user hasn't touched and they want to close the form they can. But, if they've made an entry onto the form (and created an entry in the autonumber field) then they can't close or move from the record without completing all the required fields.

Or something like that!
 

Users who are viewing this thread

Back
Top Bottom