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

Object Required

Status
Not open for further replies.

btrini10

IS-IT--Management
Dec 5, 2006
73
US
If Me![searchstartreviseddate] Is Null And Me![searchendreviseddate] Is Null Then
strFilter10 = "[Latest_Date] Like '*' OR [Latest_Date] Is Null"
Else
If Me![searchstartreviseddate] Is Null Then
strFilter10 = "[Latest_Date] <= #" & Me![searchendreviseddate] & "#"
Else
If Me![searchendreviseddate] Is Null Then
strFilter10 = "[Latest_Date] >= #" & Me![searchstartreviseddate] & "#"
Else
strFilter10 = "[Latest_Date] >= #" & Me![searchstartreviseddate] & "# And [Latest_Date] <= #" & Me![searchendreviseddate] & "#"
End If
End If
End If

Above is my code for which I keep getting an object required message. I am thinking it is something with the Me![searchendreviseddate] statement. Can anyone offer some advice?
Thanks
 
what sort of object is "searchendreviseddate" ?

On your form are there any blank white boxes that should have something else in them...?

Hope this helps!

Regards

BuilderSpec
 
Is that the syntax starts like
[tt]
If IsNull(Me![searchstartreviseddate]) Then
...........[/tt]


continue...

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
How are ya btrini10 . . .

. . . and your logic needs to be checked! . . .

Calvin.gif
See Ya! . . . . . .
 
Thanks ZMR Abdullah, it works. AceMan, I will check the logic.
 
I'd use syntax like this:
If IsDate(Me![searchstartreviseddate]) Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
btrini10 . . .

Actually its not the logic as much as its the way its written. Should be more like:
Code:
[blue]   Dim SSRD As Date, SERD As Date
   
   SSRD = Me![[u]s[/u]earch[u]s[/u]tart[u]r[/u]evised[u]d[/u]ate]
   SERD = Me![[u]s[/u]earch[u]e[/u]nd[u]r[/u]evised[u]d[/u]ate]
   
   If SSRD Is Null And SERD Is Null Then
      strFilter10 = "[Latest_Date] Like '*' OR " & _
                    "[Latest_Date] Is Null"
   ElseIf SSRD Is Null Then
      strFilter10 = "[Latest_Date] <= #" & SERD & "#"
   ElseIf SERD Is Null Then
      strFilter10 = "[Latest_Date] >= #" & SSRD & "#"
   Else
      strFilter10 = "[Latest_Date] >= #" & SSRD & "# And " & _
                    "[Latest_Date] <= #" & SERD & "#"
   End If
   
   Set SERD = Nothing
   Set SSRD = Nothing[/blue]

Calvin.gif
See Ya! . . . . . .
 
If SSRD Is Null And SERD Is Null Then
Sorry, but only Variants may be null ...
 
PHV . . .

Just giving an idea of what the code should look like . . . not the actual . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top