Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERROR MESSAGE

Status
Not open for further replies.

csegal

Technical User
Jun 12, 2001
38
US
Help!!!
I have a form where when I press a button to print tjhe form,
several things take place.
1) Data is saved
2) A new form is to open up
3) The new form cursor should start at a particular place

The problem is that everything works sometimes!
Sometimes I get an ERROR MESSAGE:
YOU CAN'T GO TO THE SPECIFIED REORD
YOU MAY BE AT THE END OF A RECORD SET
I have a manual button that creates a new record (Blank Form) and that works just fine.
The code for the print button I have is as follows:

Private Sub Command23_Click()
On Error GoTo Err_Command23_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.PrintOut acSelection
DoCmd.GoToRecord , , acNext
DoCmd.GoToControl "ETR Number"


Exit_Command23_Click:
Exit Sub

Err_Command23_Click:
MsgBox Err.Description
Resume Exit_Command23_Click

End Sub

This is perplexing!
Please help!
C.Segal
csegal@arrowair.com
 
What version of Access are you using? I tried it in XP and it worked finel.
 
OOOps,,,I am using Access 97...
Not my choice, It a network thing using windows 98
 
I may have forgot to mention...
Everything seems to work ok for about 5 to 10 records,,,then I get the error

When I manually forward to the next record and press the print button sometimes I get the error and sometimes I don't so I am not too sure of the regularity of the error.
 
Sorry, can't really speak for 97. Never used it.

However, I think I missed part of the point. Are you editing existing records or entering new records. If you are editing, then it makes since that you are at the end of a recordset. If you are adding new records, switch the following code:

DoCmd.GoToRecord , , acNext

to:

DoCmd.GoToRecord , ,acNewRec
 
There is simply a lock on the amount of records allowed, either on a table or on the form. If you go into properties and under format there is sections for lock records, i can't be sure this is exactly it but the solution is one of those properties.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top