Using Is Not Null in openrecordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText])" Is Not Null, dbOpenDynaset)

MiscText is a text filed

I'm getting a Type Mismatch error
 
Is Not Null is part of the SQL statement so it needs to be inside the
quotes. Try:

Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText]) Is Not Null", dbOpenDynaset)

Good luck.

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
Try:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where [MiscText]
Not IsNull", dbOpenDynaset)
 
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where [MiscText]
Is Not Null", dbOpenDynaset)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Alex Dybenko said:
Try:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText] Not IsNull", dbOpenDynaset)

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


jsccorps said:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText])" Is Not Null, dbOpenDynaset)

MiscText is a text filed

I'm getting a Type Mismatch error
 
Like I said! :-)

Sco

M.L. "Sco" Scofield, Microsoft Access MVP, MCSD, MCP, MSS, A+
Denver Area Access Users Group Vice President www.DAAUG.org
MS Colorado Events Administrator www.MSColoradoEvents.com
Useful Metric Conversion #18 of 19: 8 nickels = 2 paradigms (My personal
favorite)
Miscellaneous Access and VB "stuff" at www.ScoBiz.com


Douglas J. Steele said:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where [MiscText]
Is Not Null", dbOpenDynaset)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Alex Dybenko said:
Try:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText] Not IsNull", dbOpenDynaset)

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com


jsccorps said:
Set rs = CurrentDb.OpenRecordset("Select * From [AgentData] where
[MiscText])" Is Not Null, dbOpenDynaset)

MiscText is a text filed

I'm getting a Type Mismatch error
 
Back
Top