Search by Date problem

J

JMK

Good Afternoon All,

I have a wee problem with one of my forms. The query the form is based on is
designed to look through a table (tblFlightLog) and return all the flights
flown on a specific day (along with searches for Flight Number, Aircraft and
Journey Log), and display that information.

The system is designed so the user inputs the date they want to view on one
form (called frmSearchFlts), hits button where a second form (frmViewFlts) is
displayed with the information.

This all works well for Journey Log, Aircraft and Flight Number, as well as
any date which would not conflict with a month (for example anything above
the 12th of a month).

I have checked and made sure that ever date field within the table and on
the forms is set to Short Date (Canadian) and my computer system settings
also default to this.

What is interesting though is when I run frmViewFlts on its own (without
going through the first form) all dates are displayed. It is only when I run
it from the first form I have my problem.

Any ideas on what I could do?
 
N

NKTower

You didn't specify How you establish the condition on ViewFlights based upon
the input in SearchFlights.

I had to Google to find out what Canadian date format is - dd/mm/yy[yy]

One way to be absolutely sure that Access knows what do do would be to
convert the month to the character form, e.g.

Dim str_Where As String
str_where = "( flight_date = #12 Oct 2008# )"
DoCmd.OpenForm "frmViewFlights",acNormal,,str_Where

Write a throw-away query first to make sure that the synax is good. For
example, it might prefer seeing "(flight_date = #Oct 12 2008#)", eh?
 

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