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 / January 2007

Tip: Looking for answers? Try searching our database.

If then help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Snidow - 31 Jan 2007 18:26 GMT
Greetings all.  I am using Access 2003 and I can not figure out how to get
the following to work in the click event of a command button.

If Me.cboEWO.Value = null Then
 MsgBox "Enter an EWO"
Else
rest of code.

cboEWO is a combo used for searching.  When a value is chosen by cascading
or entering in a value a command button is hit to pass the value to a stored
procedure.  Upon hitting the command button I would like the user to see the
message if no value has been entered in cboEWO.  I tried every variation of
the above, but my skills in Access are lacking.  Thank you for any help.
SusanV - 31 Jan 2007 18:49 GMT
You can't check for null with "= null" - you need to use the IsNull
function:

If IsNull(Me.cboEWO) Then
   'dosomething
Else
   'do something else
End If

If you want to go the other way, you can use:

If Not IsNull(me.cboEWO) then
   'dosomething else
Else
   'do something
End If

Similarly, in SQL, you would use "SELECT Field FROM Table WHERE Field Is
Null" rather than "field = Null"

Signature

hth,
SusanV

> Greetings all.  I am using Access 2003 and I can not figure out how to get
> the following to work in the click event of a command button.
[quoted text clipped - 12 lines]
> of
> the above, but my skills in Access are lacking.  Thank you for any help.
Greg Snidow - 31 Jan 2007 19:27 GMT
Thank you so much SusanV.  I knew it would be something easy.

> You can't check for null with "= null" - you need to use the IsNull
> function:
[quoted text clipped - 32 lines]
> > of
> > the above, but my skills in Access are lacking.  Thank you for any help.
SusanV - 31 Jan 2007 19:37 GMT
Glad to help any time!
;-D

> Thank you so much SusanV.  I knew it would be something easy.
>
[quoted text clipped - 39 lines]
>> > the above, but my skills in Access are lacking.  Thank you for any
>> > help.
 
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.