Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

If statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Martinez - 04 Aug 2005 03:12 GMT

Hello,

I am having a problem with my ElseIf statement which is in my form event
(Before update) I have two fields one call AssignedOn, which is a date field
and the other is AssignedTo a text field.  My problem is I get a error
message -Run time error "424"  Object Required using the below code.  What I
want is when the user populate the AssignedTo field (User Name) and forgets
to put a date on the AssignedOn date field I want an error message pop up.
This is the last piece of code that I have in my If statement, but I can't
figure it out. I would appreciate any tips.  Thank you.

ElseIf Me.[AssignedOn] Is Null And Me.[AssignedTo] Is Not Null Then
       Cancel = True
       MsgBox "Sorry, You must assigned this policy to a user. Try Again"

End If
FSt1 - 04 Aug 2005 16:08 GMT
hi,
i may be wrong but looks like it might be a syntax thing.
Is null should be 1 word ie IsNull. and Is Not Null should be Not IsNull
if that do work then you might look into error handling.
at the top of you sub put something like ....
On Error goto MySub_err
then at the  bottom of the sub put some like
mySub_Exit:
   Exit sub

MySub_Err:
   If Err.number = 424 then
      Msgbox("Sorry, You must assigned this policy to a user. Try Again")
      Resume Mysub_Exit
   end if
end sub

good luck
FSt1

>  
> Hello,
[quoted text clipped - 13 lines]
>
> End If
Alex Martinez - 05 Aug 2005 01:37 GMT

> Hello,
>
[quoted text clipped - 12 lines]
>
> End If
Alex Martinez - 05 Aug 2005 01:37 GMT

>> Hello,
>>
[quoted text clipped - 13 lines]
>>
>> End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.