new run-time errors in existing db

S

SDMaryanne

I created an Access db 4 years ago, and it's been running perfectly until
today. The opening criteria form has 7 text boxes that can be filled in or
left blank. The first is for location, the next 2 are starting & ending
dates, the last 4 are other criteria like document number or item
description. When the fields are filled out, there is a command button to
"get selected records." This runs a dynamic query and then displays the
report.
The location has two choices, PLC or OTC. If I enter OTC, it runs fine and
the report displays. However, now if I enter PLC, I get a run-time error
'94': invalid use of Null. I get the same error if I enter a value for a
start date. However, if I leave these fields blank and specify criteria in
any of the bottom 4 boxes, everything runs fine. When I get the run-time
error, the underlying query can be seen, but the report doesn't display.
If I enter a value in the end date box, I get a different run-time error
'3075': syntax error in date in query expression '7#. (when I entered 1/1/07
for the end date)
I've done nothing to the code, and can't for the life of me, figure out
what's going on. Anyone have any suggestions??? Thanks for your help
 
F

FBxiii

Just a thought but have you tried entering your date in full? i.e. 01/01/2007

The form/query/report may be using some kind of formatting that is being
'knocked out' by not entering the date in full (Maybe :/)

Are you able to view the code?
 
S

SDMaryanne

Yes, I've tried that. I get the same error code, but instead of '7#' it shows
'007#'
 
S

SDMaryanne

Never mind, I've discovered some missing cells of data in one of the
underlying tables. I deleted those rows and that cleared up my first error
problem. Then I realized that I never set the code to deal with strictly an
"end date." It works when you enter both start & end. I just added another
line of code.
 
G

gllincoln

Hi, Maryanne,

If you haven't changed the code then it's probably a record with a null
field in a column where you aren't expecting to find a null. An unexpected
Null can break code that has been flawlessly executing since Babbage
started daydreaming... :) Manually create the query that you are building
outside of the form, run it (changing it to a select query if necessary) and
see what is in that recordset.

Hope this helps,
Gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top