ineedahelp
Technical User
I keep getting an error "object doesn't support this property or method" whenever I try to set the focus to the control [DatePerformed] on my subform. NOTE: it is a new record which may be an issue... (I added the stars to highlight for purposes here)
Code:
Private Sub cmbAddTask_Click()
Dim strAnswer As String
Dim Msg, Style, Title
Forms!frmTravelExpense!subfrmTravelExpense.Form.AllowAdditions = True
Me.SetFocus
Me.subfrmTravelExpense.SetFocus
'Forms!frmTravelExpense!subfrmTravelExpense.Form.SetFocus
** DoCmd.GoToRecord , , acNewRec
'Forms![frmTravelExpense]![subfrmTravelExpense].Form![MemberID].SetFocus
Forms!frmTravelExpense!subfrmTravelExpense.Form![MemberID] = Me.MemberID
Forms!frmTravelExpense!subfrmTravelExpense.Form![Description] = "Travel Expense"
** Forms!frmTravelExpense!subfrmTravelExpense.Form![DatePerformed].SetFocus
Forms!frmTravelExpense!subfrmTravelExpense.Form.AllowAdditions = False