Object doesn't support this property or method

C

ChuckW

hi,

I don't know vba code well. I am trying to recreate a subform from another
application and place it in a new form. It is a call log with several text
boxes. Most are blank and need to be filled in by the users except the first
field called BusinessDate which has all weekdays in 2008 and 2009.. The data
gets imputted into a form which is based on a query. I had the old form,
which works successfully, open to today's date (in the BusinessDate).

I copied my vba code over to the new form but when I try to open it, it
comes up with a message "Run-time error 438 - Object doesn't support this
property or method". When I click debug, here is the code. The line "
Me!BusinessDate.SetFocus" is highlighted. I can't filed command 24 in the
old database. Can someone help?

Chuck

---------------------------------------------------------------------
Option Compare Database



Private Sub BusinessDate_Click()

End Sub

Private Sub Command24_Click()
On Error GoTo Err_Command24_Click

DoCmd.Close


Exit_Command24_Click:
Exit Sub

Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click

End Sub



Private Sub Form_Open(Cancel As Integer)
Me!BusinessDate.SetFocus
DoCmd.FindRecord Date
Me!PhoneDials.SetFocus

End Sub
 
A

AccessVandal via AccessMonster.com

"I can't filed command 24 in the old database."
Do you mean to say "I can't fine "command 24" in the old database."? You have
to open up the form in design view and search for it in the new database
where you place it in that form.
Private Sub Form_Open(Cancel As Integer)
Me!BusinessDate.SetFocus
DoCmd.FindRecord Date
Me!PhoneDials.SetFocus
End Sub

"Date" is a reserved word in Access. Avoid using it to search for a date. If
you have a control and you name it as "Date", change it immeditely to
something like txtDate. Like "DoCmd.FindRecord txtDate"

Try the Dot instead of the Bang. like Me.BusinessDate.SetFocus and Me.
PhoneDials.SetFocus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top