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

Toggle control has Null value

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
In Access2003 I have a form with three toggle buttons. I run an if then on them to determine which is activated. The problem is if I don't select a toggle the value is null and I get an invalid use of null error.

What did I miss? Thanks.
 
Set a default value for the underlying field of 0, and the required property to true. This way, they will never have a null value in them.

An alternative way is to adapt your code to handle null values:

Code:
If IsNull (fieldname) Or Fieldname = 0 Then
  ' handle blank data
Else
  ' handle non blank data
End If

John
 
How are ya EddyLLC . . .

Have a look at the [blue][blue]Nz[/blue][/blue] function ...

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top