473,416 Members | 1,769 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,416 software developers and data experts.

Select ALL from an unbound form for query parameters

Hi,

Any help on this one will be greatly appreciated as I have spent too
long banging my head against the screen trying to get it sorted.
Basically I would like to have a select all records option in a combo
box that is used in an unbound form for my report parameter. I have
tried to explain it in further detail below: -

In my DB I have numerous forms are used to input details into a table
(TblMasterTable).

In the input forms I have combo boxes that are used to populate fields
in the master table. The combo boxes in the forms are bound to tables
(e.g. TblComboHRAreas).

I have reports set-up that run from queries that use the data in the
master table. The parameters for the queries are linked to an unbound
form (FrmParam) that has the following fields on it: -

StartDate
EndDate
HRArea (Combo box that uses the records in TblComboHRAreas for its
selection)
Team (Combo box that uses the records in TblComboTeam for its
selection)

I have the following expressions in the queries for the parameter
fields:

HRArea (expression): - [Forms]![FrmParam]![HRArea]

The reports work fine with you select a HR Area from the combo box.
The problem I am experiencing is to select all records from the combo
source (TblComboHRAreas).

I have tried replacing the above expression with the following: -

Like IIf([Forms]![FrmParam]![HRArea]=0,"*",[Forms]![FrmParam]![HRArea])

I have also tried replacing the 0 with isnull, "", nil etc. with no
success as the problem seem to be that when the wildcard * is does not
extract all records instead I get no records.

Thats about it. Thanks in advance if you can help solve my problem.

Dec 22 '05 #1
3 2246
Try this

Change the criteria in the query to

[Forms]![FrmParam]![HRArea] OR [Forms]![FrmParam]![HRArea] Is Null

You can use this technique for multiple fields in your query but the
query design gets complicated quickly. I find that for simplicity, a
set of cascading queries works quite well so that each query filters a
bit of the info and is used to build the next one.

Geoff

Dec 22 '05 #2

Hi Geoff,

Thanks for your suggested solution. It was simple to implement and
worked perfectly, it will also go along way towards helping my sanity.

Thanks again and I hope you enjoy the New Year celebrations.

Cheers,

Stig
*** Sent via Developersdex http://www.developersdex.com ***
Dec 29 '05 #3
Nice to know it works OK. I found this one at

http://www.mvps.org/access/

It's good place to look for help.

Happy New Year

Dec 30 '05 #4

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

Similar topics

14
by: Jos? | last post by:
This one droves me completely mad. I did not succeed to exploit the track given to me by Bob. I have : three tables : Clubs, Persons and ClubsPersons that join the two first in a many to many...
1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
1
by: huela | last post by:
Somehow i have to display the recordset in unbound form When i use the following display the data in recordset to unbound form. I have a question: i can only display the last record data, all...
2
by: Arnold | last post by:
Greetings Gurus, In a report showing the names of students and their progress, I am getting an error in the name field (Name: #Error). The report gets its data from an unbound form containing...
3
by: phonl | last post by:
I am a vb6 ADO developer looking at vb.net 2005 and ADO2.net. I used the vb.net 2005 data wizard to bind some controls to a database. Now I want to run a select query and have the bound controls...
2
by: jay | last post by:
Hi. I have created an unbound combo box in a form whose purpose is to pass parameters to a query and then requery the requery. The unbound combo box is named "ClosedFilter" The two parameters...
2
by: Mark Roughton | last post by:
I have a form where the users need to view records for various criteria, one of which is a date field on which they may wish to view all related data for the selected date, for all dates upto and...
16
by: Phil Stanton | last post by:
I have a form with a button which is supposed to open an Excel file (With lots of Macros /VBA) in it. The Excel file gets it's data from the Access program Here is the code Private Sub...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.