Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Microsoft visual basic error -214735267(8002009) Their is no object in this control for the following line
Me.DTPicker1= Date 

I am using Ms Access 2010

Please help me out
Thanks

The code is as follows
VB
Private Sub Form_Load()

   On Error GoTo Form_Load_Error

    Debug.Print "Entering Form_Load"

    If Date > CDate("3/31/" & CStr(Year(Now))) Then
          Me.DTPicker1 = Date
    Else
        Me.DTPicker1 = DateAdd("y", -1, Date)
    End If
    
    GBL_Page = 1
    
    Load_Search_Values

On Error GoTo 0
    Debug.Print "Exiting Form_Load"
    Exit Sub

Form_Load_Error:

    If (Err.Source = "ABC") Then
        Err.Raise Err.Number, "Form_Load", Err.Description
    Else
        Err.Raise Err.Number, "Form_Load -> " & Err.Source, Err.Description
    End If

End Sub
Posted
Updated 14-May-12 18:17pm
v5
Comments
OriginalGriff 14-May-12 10:11am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
mmsgk251804 21-May-12 6:50am    
okay sir
Sandeep Mewara 15-May-12 2:07am    
We already shared our view. Now what is the issue? Did you try the answer given below?
mmsgk251804 21-May-12 6:53am    
In MS acess 2010 datePicker doesn't work , instead need to use a Calendar for it I think so . The above code works fine for MS Access 2003

Me.DTPicker1 sounds like a date picker control. So wouldn't this have to be something like this instead:
VB
me.DTPicker1.Value = Date


or maybe even

VB
me.DTPicker1.Date = Date


assuming Date is a date type.

Regards,

Manfred

[Edit]
Seems to be that the former is the correct way to do it. See here[^].
[/Edit]
 
Share this answer
 
v2
Comments
Sandeep Mewara 14-May-12 10:24am    
My 5! It took me some time to reply back.
Date is a DataType in VB. You cannot assign it to some control like above. Details here: MSDN: Date Data Type (Visual Basic)[^]

Try:
VB
Dim someDateAndTime As Date = #8/13/2002 12:14 PM#
Me.DTPicker1.Value = someDateAndTime 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900