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)
Im also having trouble with the following code which I have in my onopen event.
I get errors on the setfocus line and the assignment to my field MemberID. Thank you for any help!
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
Im also having trouble with the following code which I have in my onopen event.
Code:
DoCmd.GoToRecord , , acFirst
'Forms!frmTravelExpense!MemberID.SetFocus
Forms!frmTravelExpense!MemberID = mMemberID
Me.subfrmTravelExpense.Form.Filter = "[Description] = 'Travel Expense'"
Me.subfrmTravelExpense.Form.FilterOn = True