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

Tip: Looking for answers? Try searching our database.

change null to a value of 0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Slez - 20 Jun 2007 13:57 GMT
I have a control on a form with a default value of "0" that users have
occasionally started to change the value in the control, but then exit the
form with a Null value.  This affects various reports that include this data.

I'd like to have the value return to 0 either in the event they exit the
control without typing in a value.  I am assuming it would require code in
the On Exit Event of that control, but I am not sure what code would
accomplish this.

I would appreciate any help!!
SusanV - 20 Jun 2007 14:26 GMT
If Nz(Me.YourControl,"") = "" Then
   Me.YourControl = 0
End if

Signature

hth,
SusanV

>I have a control on a form with a default value of "0" that users have
> occasionally started to change the value in the control, but then exit the
[quoted text clipped - 7 lines]
>
> I would appreciate any help!!
Slez - 20 Jun 2007 14:35 GMT
Thanks for the reply!
Slez

>If Nz(Me.YourControl,"") = "" Then
>    Me.YourControl = 0
[quoted text clipped - 5 lines]
>>
>> I would appreciate any help!!
Arvin Meyer [MVP] - 20 Jun 2007 14:33 GMT
Try something like this in the control's after update event:

Sub MyControl_AfterUpdate()
   If Len(Me.MyControl & vbNullString) = 0 Then
       Me.MyControl = 0
   End Sub
End Sub

Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

>I have a control on a form with a default value of "0" that users have
> occasionally started to change the value in the control, but then exit the
[quoted text clipped - 7 lines]
>
> I would appreciate 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.