Hi,
I have [frmStoreDemographicsUpdate] that opens from [frmStoreDemographicsLookup]. [frmStoreDemographicsLookupLog] also opens to store info for requerying [frmStoreDemographicsUpdate]. All of this works fine. If txtStoreStatusEndDate on [frmStoreDemographicsLookupLog] is null, cmdEnable should not be disabled. If there is a date in txtStoreStatusendDate, cmdEnable should be disabled. The code isn't working. I've uploaded a stripped down version of the database.
Thanks,
Leesha
Not is Null code not working
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Not is Null code not working
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78547
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Not is Null code not working
The text box isn't null, it contains the empty string "". Try this line:
ElseIf Nz(Forms!sfrmStoreDemographicsLookupLog!txtStatusEndDate) <> "" Then
ElseIf Nz(Forms!sfrmStoreDemographicsLookupLog!txtStatusEndDate) <> "" Then
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: Not is Null code not working
That worked perfectly! I didn't realize you could use Nz for anything but numbers. Does it work with text as well?
Thanks!
Leesha
Thanks!
Leesha
-
- Administrator
- Posts: 78547
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Not is Null code not working
Yes, you can use Nz with text fields/controls too. There are two forms:
Nz(expression) returns expression unless that is Null, then it returns an empty string "". It is equivalent to Nz(expression, "").
Nz(expression, "alternative") returns expression unless that is Null, then it returns "alternative".
Nz(expression) returns expression unless that is Null, then it returns an empty string "". It is equivalent to Nz(expression, "").
Nz(expression, "alternative") returns expression unless that is Null, then it returns "alternative".
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: Not is Null code not working
Thanks for the info. Ahhhhh, the possiblities!
Leesha
Leesha