Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Open Form Displaying Records that Meet the Criteria selected

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bubu85238 - 25 May 2008 08:34 GMT
Hi,

I am trying to open a form in Access 2003, based on the criteria selected in
another form.

Here are my TABLES and fields:
SEARCH:  date, time (all text fields)
TIMESLOTS:  id, date, time (all text fields)

Here are the FORMS and fields:
SEARCH:  date, time
SEARCH RESULTS:  id, date, time

What I would like to do is open the SEARCH form and select a date, module,
and time; then press a button to open the SEARCH RESULTS form displaying only
the records that meet the criteria selected in the SEARCH form.

I have tried using a query and building the SEARCH RESULTS form from the
query, where the query included conditions on the date and time fields to
select the records that match the date and time fields from the SEARCH form.  
Although I dont get an error when I use a button to open the form; I get no
results.  If I open the form by opening it directly I get a pop ups asking me
to enter the date and the time and then I do get valid records in the SEARCH
RESULTS form.

What can I do to get the form to open with valid records using a button?

Thanks in advance for the help.
Rick Brandt - 25 May 2008 12:43 GMT
> Hi,
>
[quoted text clipped - 26 lines]
>
> Thanks in advance for the help.

The words "date" and "time" are reserved words (both are the names of
functions) and as such should not be used as the names of any object you
create.  Access can easily get confused between whether your query or code
is looking for YOUR date or the built in function named date.

Surrounding such field names with square brackets in queries and expressions
makes them okay to use, but a better practice is to always use names like
RecordDate, PurchaseDate, or similar so that you don't have to worry about
it.

Also to be considered is that DateTimes in Access are stored as Double
numeric types and there can be rounding that occurs to the value you "see"
compared to what is actually stored.  This can make exact comparison
criteria a problem.  You might have to use a greater-than and less-than
criteria on a very small range to get the comparisons to match up.  This
issue only applies in your case to the time field and not the date.  Note
that a single field containing both date and time is generally a better way
to store a date and time.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

Bubu85238 - 27 May 2008 16:40 GMT
Thanks for the information.  I'm using a text field for both date and time,
the reason i did thi is because I am importing the date and time values into
the table from an Excel spreadsheet where I have manually typed them in, in
the format that I want to see them in my database.  I will try putting the
name fields in brackets and see if that works with my query.

Thanks!

Jose

> > Hi,
> >
[quoted text clipped - 45 lines]
> that a single field containing both date and time is generally a better way
> to store a date and time.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.