473,473 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ComboBox help needed with selecting "ALL"...

55 New Member
Good day all...I have a combo box that selects numbers (ie. 1,2,3, etc.). What I am looking for is the combo box to have an "ALL" selection. Right now this is what I have for my SQL code:

SELECT [Fund Number Query].Funds, [Fund Number Query].Fund FROM [Fund Number Query] UNION Select "*", "(All)" From [Fund Number Query];

This is what my VB code is showing; however the error is in the:
rs.FindFirst "[Funds]=" & Str(Nz(Me![Combo1], 0)
__________________________________________________ _________
Private Sub Combo1_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Funds]=" & Str(Nz(Me![Combo1], 0)

If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Any help would be greatly appreciated. Thank you.
Jun 27 '07 #1
3 2261
eskelies
55 New Member
bump.................
Jun 28 '07 #2
eskelies
55 New Member
I ended up figuring out a way to make it work without adding "ALL." For anyone that cares I placed the following into the criteria of the query.

[forms]![Final 12 Month Rolling Turnover Report].[combo1] is null
Jul 3 '07 #3
puppydogbuddy
1,923 Recognized Expert Top Contributor
Good day all...I have a combo box that selects numbers (ie. 1,2,3, etc.). What I am looking for is the combo box to have an "ALL" selection. Right now this is what I have for my SQL code:

SELECT [Fund Number Query].Funds, [Fund Number Query].Fund FROM [Fund Number Query] UNION Select "*", "(All)" From [Fund Number Query];

This is what my VB code is showing; however the error is in the:
rs.FindFirst "[Funds]=" & Str(Nz(Me![Combo1], 0)
__________________________________________________ _________
Private Sub Combo1_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Funds]=" & Str(Nz(Me![Combo1], 0)

If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Any help would be greatly appreciated. Thank you.

I think your problem is the syntax you are using. You are using numeric syntax applied to a string.

Do Either 1 or 2 below:
1. rs.FindFirst "[Funds]= '" & Str(Nz(Me![Combo1], 0) & "'" 'for text syntax
or
2.rs.FindFirst "[Funds]=" & Val(Nz(Me![Combo1], 0) 'for numeric
Jul 3 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Adam Toline | last post by:
In reference to the following: http://www.bellecose.com/form.htm At the top of each column there is a box for "All". When one is checked I need to check all of (and only) those boxes...
3
by: Not Me | last post by:
Hi, Is there any criteria I can use in my where clause to say 'anything'? Maybe like the _ used in some languages? For my example, I want to use an inline-if, so if a checkbox is ticked I say...
3
by: tobhamlet | last post by:
If one is using a query as a Row Source on a Form, is there a way to set up a blank space, or to insert the word "ALL" in a combo box that represents ALL combo box row items. The scenario is as...
6
by: GSteven | last post by:
(as formerly posted to microsoft.public.access.forms with no result) I've created a continuous form which is based on a straightforward table (ex - customers - 100 records). On the form there is...
4
by: meganrobertson22 | last post by:
Hi Everyone- I have a question about how to add and then use the "All" selection in a combo box. I am trying to figure out how to: (1) add "All" as a selection to a combo box and then (2)...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
6
by: Mark | last post by:
I first read about this in mvps.org, but the code he gives doesn't seem to work for my form. I"ll post my code below. I'd love it if someone could point out the error in my code. BTW, this is my...
2
by: bhdvir | last post by:
Does anybody have any advice on selecting all records within a iif-statement? I have a form in which one has to state if all projects or just a selection of projects are to be used for a query....
1
by: StuartD | last post by:
I have a sub form that is populated based on the selection of a year from a combo box on the main form. I'm trying to add a second main form combo box for item category to further filter the sub...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.