Recordset error

cbdcolga

New member
Local time
Today, 13:08
Joined
Jan 18, 2006
Messages
5
I added a command button to a form that will create a new record and keep certain fields from the previously saved record. Whenever I open the form from the database window and enter in a new record, then click the command button to move to a new record it works fine; however, when I access the form through the Switchboard and try to use the command button it gives me a "You can't go to the specified record. You may be at the end of a recordset." error.

Does anyone know what I need to do to correct this problem?
 
Is it possible that the switchboard opens the form as a Read Only, or somethign liek that? Can you post the code for both the button that opens the form and the button that moves to a new record?
 
The Switchboard Manager for this form is set to: Open Form in Add Mode

My Data Properties are:

Allow Filters: Yes
Allow Edits: No
Allow Deletions: No
Allow Additions: Yes
Data Entry: Yes
Recordset Type: Dynaset
Record Locks: No Locks

And the code for the button that moves to a new record is:

Private Sub GoToNextRecord_Click()
On Error GoTo Err_GoToNextRecord_Click

If Validate = True Then
TempAccountName = Txt_Account_Name
TempAccountNumber = Txt_Account_Number
TempOSAName = Txt_OSA_Name
TempOSAWritingNumber = Txt_OSA_Writing_Number
TempSpecialistEnumber = Txt_Specialist_Enumber

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
MsgBox "Your record has been saved. Click OK to enter a new record for this Account.", vbInformation
DoCmd.GoToRecord , , acNewRec

Txt_Account_Name = TempAccountName
Txt_Account_Number = TempAccountNumber
Txt_OSA_Name = TempOSAName
Txt_OSA_Writing_Number = TempOSAWritingNumber
Txt_Specialist_Enumber = TempSpecialistEnumber

Txt_Territory.SetFocus
End If

Exit_GoToNextRecord_Click:
Exit Sub

Err_GoToNextRecord_Click:
MsgBox Err.Description
Resume Exit_GoToNextRecord_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom