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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with SET FOCUS on new record on subform

Status
Not open for further replies.

ineedahelp

Technical User
Mar 31, 2009
27
US
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
 



Hi,

If this is MS Access Forms, you might get better results in mone of the many MS Access forums like forum702.

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top