473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Disable criteria of a query based on checkboxes

I have a form with fields that act as user specified criteria for a
form. Two of the fields are start and finish date. The fields in my
query are "ID", "TimeStart", "TimeEnd", etc. Currently, I have the
following:

Between [Forms]![FormName]![Start] And [Forms]![FormName]![Finish]

Currently, the user will specify the start and finish date, and the
query will find data where both TimeStart and TimeEnd fall between
that date. However, I want the user to be able to specify, with a
checkbox maybe, if the start and finish date refers to TimeStart only,
TimeFinish only, or both. Is there a way to disable or enable the
criteria of a query like this??

THanks,

Matt
Nov 13 '05 #1
1 2768
HJ
I don't know a way to do this in the query itself, but you can program it in
VBA. The code can follow this logic:

If start has been entered, then use the string "TimeStart>=" & Me.Start
If finish has been entered, then ...
If start has been entered, add " AND " to the string.
and append the string with "TimeEnd<=" & Me.Finish

Then you can rewrite the SQL for the query or specify a form filter for your
second form.

There may be better ways, and I do not know all about your situation, but
this is one way to accomplish what you want.

HJ

"Matthew" <ma************@eaton.com> wrote in message
news:7f**************************@posting.google.c om...
I have a form with fields that act as user specified criteria for a
form. Two of the fields are start and finish date. The fields in my
query are "ID", "TimeStart", "TimeEnd", etc. Currently, I have the
following:

Between [Forms]![FormName]![Start] And [Forms]![FormName]![Finish]

Currently, the user will specify the start and finish date, and the
query will find data where both TimeStart and TimeEnd fall between
that date. However, I want the user to be able to specify, with a
checkbox maybe, if the start and finish date refers to TimeStart only,
TimeFinish only, or both. Is there a way to disable or enable the
criteria of a query like this??

THanks,

Matt

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
Here is the scope of what I need to do; want: enrollment_year allowed (even if null) all of ica criteria:
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
2
by: neptune | last post by:
I have a query where each customer has an or . Sometimes both fields for a customer are populated, but if is null, then will be populated and vice versa. I have a form, , where I select a...
1
by: jaYPee | last post by:
I'm having problem w/ my query on how to filter a record based on the criteria i give. here's the tables students table id program course table
2
by: Matthew | last post by:
Hey , I have built a query which takes values from unbounded fields on a form, and it all works except for one thing. I have a few fields in my query that are dates. I also have a start and...
8
by: Steve Jorgensen | last post by:
Mailing List management is a good example of a case where my conundrum arises. Say there is a m-m relationship between parties and groups - anyone can be a member of any combintation of groups. ...
7
by: keliie | last post by:
Hello Just a quick question that I've spent a few hours trying to solve with no luck (although one would think this should be fairly easy). I have a form with a subform. The subform is based...
5
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: ...
0
by: mmueller | last post by:
I am new to reporting services 2005 (reporting in Access for years and older versions of Reporting Services from time to time) and this is probably a dumb question... but I have no internal resources...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.