Solved Hide Next Record Button when on a New Record

Bean Machine

Member
Local time
Today, 15:23
Joined
Feb 6, 2020
Messages
102
Hi Everyone! Hope you are all having a nice day! I have been attempting to make it so that the button for "Next Record" that I have on my form is not visible when a user is on a "New Record". How can I go about trying to hide the button and showing it when the user is not on a "New Record"? Here is what I have tried but it does not work:

Private Sub Form_Current()
If acNewRec = True Then
Me.btn_GoNext.Visible = False
Else
Me.btn_GoNext.Visible = True
End If
End Sub

Any help, as always, is greatly appreciated! Thanks!
 
Hi. Just a guess but maybe try something like:

Code:
Me.btn_GoNext.Visible = (Me.CurrentRecord<>Me.Recordset.RecordCount)

Hope that helps...
 
Took your feedback and came up with something like this which seems to work quite well:

If Form.NewRecord = True Then
Me.btn_GoNext.Visible = False
Else
Me.btn_GoNext.Visible = True
End If

In future I am most likely going to create a variable that will track if a user is on a "New Record" and then just use that variable where needed but this will do for now. Thanks for the help by the way! You've been a great help to me ever since I started with access, it's been quite the journey!
 
Took your feedback and came up with something like this which seems to work quite well:

If Form.NewRecord = True Then
Me.btn_GoNext.Visible = False
Else
Me.btn_GoNext.Visible = True
End If

In future I am most likely going to create a variable that will track if a user is on a "New Record" and then just use that variable where needed but this will do for now. Thanks for the help by the way! You've been a great help to me ever since I started with access, it's been quite the journey!
Hi. Glad to hear you got it to work. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom