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!

Run-Time error '2109':

Status
Not open for further replies.

csegal

Technical User
Jun 12, 2001
38
US
Help... On my form i have a button that does several things...
1). Saves the record
2). Prints the current record
3). Advances to the next new (blank) form (record)
4). Places the cursor at the field named ETR as the starting point for the next new record.

Often times but not every time I get an error message that
says:
Run-Time error '2109'
There is no field named 'ETR' in the current record.

I then have an option to END or DEBUG,
When I click DEBUG the code that is highlighted is:
DoCmd.GoToControl "ETR"

I DO clearly have a field named ETR in both the table and form.

My entire code for this button is as follows:

Private Sub Command23_Click()


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

Exit_Command23_Click:
Exit Sub


End Sub

Is something wron or missing???
I am using Access 97 on Windows 98

Thanks again,
csegal@arrowair.com
 
Try this....

Instead of-

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

Use-

DoCmd.Save acForm, "YourFormName"
DoCmd.PrintOut acSelection
DoCmd.GoToRecord , , acNewRec
Me.ETR.setfocus

Hope this helps.
 
you can also just set the tab order of the form so that ETR is the first field, then it will always go there and you dont have to write any code for it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top