473,505 Members | 15,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need some combo advice


I basically have a form with a subform with two combo boxes on the main
form which filter the subform. The code below works except I cant seem
to get it to show all the worksheets when there is nothing in the buyer
combo or status combo. Can someone please advise...thank you.

For ease of naming:

Form X - frm01

Subform - Subf02

Combo Buyer - ByrCombo

Field Buyer - BuyerName

Combo Status - StatusCombo

Field Status - Status

So far the code I have is this:

Private Sub Command19_Click()

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "frm02"

If Not IsNull(Me!ByrCombo) Then

stLinkCriteria = "[BuyerName]=" & Me!ByrCombo

End If

If IsNull(Me!ByrCombo) Then

stLinkCriteria = "[BuyerName]=" & "*" 'Here I am trying to get it to
show all records if its null

End If

If Not IsNull(Me!StatusCombo) Then

If Len(stLinkCriteria) <> 0 Then

stLinkCriteria = stLinkCriteria & " AND "

End If

stLinkCriteria = stLinkCriteria & "[Status] = " & Me!StatusCombo

[Child0].Requery

End If

End Sub
--
Posted via http://dbforums.com
Nov 12 '05 #1
1 1761
Try using "[Fieldname] LIKE '" & strValue & "*'" or something along
those lines. Check www.mvps.org/access for this. I know it's there
in the forms section. look for something like Filter + combobox, and
you should find it.
Nov 12 '05 #2

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

Similar topics

4
4245
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
2
1209
by: Ray Bell | last post by:
There are 2 tables, a table called parent and a table called child. The parent table has 2 fields, an ID (AUTO Number: PK) and Name (Parent Name) The Child Table has 3 fields, an ID (AUTO...
3
3138
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
1
321
by: Gary | last post by:
I am working on this database that has a table ( tbl_main ) with the following 3 fields (amongst many fields in the table): Product, PanelType and Thickness Product (text field - combo box...
3
5322
by: Mike Jakes | last post by:
I hope that someone can offer a little advice on this one - I've searched the group but can't find an answer. I think that I'm doing something really stupid or missing something trivial, but see...
0
1584
by: Tom | last post by:
I have some very strange issues with combo boxes on a tab control. Here's the scenario: I have a Windows Forms form that has a tab control on it, with two (2) tabs. Tab 2 happens to have a number...
4
1992
by: jim | last post by:
So I've had my knuckles rapped by a pro who can offer only vauge advice. I need to reduce the size of one of my tables. Here is the scene: I'm trying to track lots of test scores for individual...
2
7016
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
10
8477
by: bettyboo | last post by:
Hi all I got some really useful advice from here with my last question so I'm back for more! Only my second post so please bear with me - I'm very new to this so this will probably not be as...
0
7218
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
7103
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
7307
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
7370
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
5614
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,...
1
5035
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...
0
4701
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
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.