I have only a table. I put in a tab control, a subform with a form view at that table and a subform with a dtasheet view. when I insert a row in the first subform, it apears not a the begin of the table enad not at the end, but in random position.
I have to buttons: add, save:
the name of the first subform is baza and the name of the form in datasheet view is table1sf.
Private Sub add_Click()
On Error GoTo Err_add_Click
Me!baza.SetFocus 'Set the focus to the 1st subform
Me!baza.Form![cnp].SetFocus 'Set the focus to the subForm primary key field
DoCmd.GoToRecord , , acNewRec
Exit_add_Click:
Exit Sub
Err_add_Click:
MsgBox Err.Description
Resume Exit_add_Click
End Sub
Private Sub save_Click()
On Error GoTo Err_save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Table1sf].Requery
Exit_save_Click:
Exit Sub
Err_salveaza_Click:
MsgBox Err.Description
Resume Exit_save_Click
End Sub
I have to buttons: add, save:
the name of the first subform is baza and the name of the form in datasheet view is table1sf.
Private Sub add_Click()
On Error GoTo Err_add_Click
Me!baza.SetFocus 'Set the focus to the 1st subform
Me!baza.Form![cnp].SetFocus 'Set the focus to the subForm primary key field
DoCmd.GoToRecord , , acNewRec
Exit_add_Click:
Exit Sub
Err_add_Click:
MsgBox Err.Description
Resume Exit_add_Click
End Sub
Private Sub save_Click()
On Error GoTo Err_save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Table1sf].Requery
Exit_save_Click:
Exit Sub
Err_salveaza_Click:
MsgBox Err.Description
Resume Exit_save_Click
End Sub