Open form with WHERE query (easy)

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I'm new to this so here goes. I'm trying to open a form
and limit the records those that have not yet been
completed (i.e. field "END_DATE" = Null).

To my suprise a modification of the code from the Open
Form Wizard doesn't work:

---
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[END_DATE] = Null"
stDocName = "isolation"
DoCmd.OpenForm stDocName, , , stLinkCriteria
---

Any ideas?

Thanks,

-Jon
 
Jon said:
I'm new to this so here goes. I'm trying to open a form
and limit the records those that have not yet been
completed (i.e. field "END_DATE" = Null).

To my suprise a modification of the code from the Open
Form Wizard doesn't work:

---
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[END_DATE] = Null"
stDocName = "isolation"
DoCmd.OpenForm stDocName, , , stLinkCriteria

By definition, nothing is ever equal to Null. In a query or
where-condition, use "Is Null" instead:

stLinkCriteria = "[END_DATE] Is Null"
 
-----Original Message-----
I'm new to this so here goes. I'm trying to open a form
and limit the records those that have not yet been
completed (i.e. field "END_DATE" = Null).

To my suprise a modification of the code from the Open
Form Wizard doesn't work:

---
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "[END_DATE] = Null"
stDocName = "isolation"
DoCmd.OpenForm stDocName, , , stLinkCriteria

By definition, nothing is ever equal to Null. In a query or
where-condition, use "Is Null" instead:

stLinkCriteria = "[END_DATE] Is Null"

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
If it weren't for those darn universal constants I'd be
much better at this...

Thanks for your help.

-Jon
 
Back
Top