Eljefegeneo
Still trying to learn
- Local time
- Today, 14:31
- Joined
- Jan 10, 2011
- Messages
- 902
If I use the standard VBA to open a specific form, that is:
I open the exact record I want.
But when I get to frmNewNames and then want to go to the next record it says I cannot. I've looked up a solution but can't seem to find one that works. I was using the standard gotonext macro, then tried.
And variations of the above to no avail. If I tell it to remove the filters first before going to a new record,
But that gets me to the next record only and no further.
I also would like the filter to be removed and have the ability to go to the previous record.
Code:
DoCmd.OpenForm "frmNewNames", , , "ID = " & Forms!frmLastN.txtLastN
But when I get to frmNewNames and then want to go to the next record it says I cannot. I've looked up a solution but can't seem to find one that works. I was using the standard gotonext macro, then tried.
Code:
DoCmd.GoToRecord acDataForm, "frmNewNames", acGoTo, 7
Code:
Me.Filter = ""
Me.FilterOn = False[\code]
It still won't go anywhere.
I then tried the following found on a forum:
[code]Filter = ""
FilterOn = False
Const NO_NEXT_RECORD = 2105
Me.AllowAdditions = True
On Error Resume Next
DoCmd.GoToRecord acDataForm, "frmNewNames", acGoTo, 7
Select Case Err.Number
Case 0
Case NO_NEXT_RECORD
Case Else
MsgBox Err.Description, vbExclamation, "Error"
End Select
But that gets me to the next record only and no further.
I also would like the filter to be removed and have the ability to go to the previous record.