473,796 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

filtering form by combo box not really working

Hi folks.

My database project has the following:

--------------------------------------------------------------------------------
tables:
Member: MemName, MemNo [PK], MemType, CourseFaculty
History: contains all of the above

queries:
qryHistory: based on History

forms:
frmHistory: based on qryHistory. MemNo, MemType and CourseFaculty is
not Enabled and not Visible. Also contains a combo box "cboName", and
a label "lblTitle".
--------------------------------------------------------------------------------

frmHistory is used to display the borrowing habits of members (i.e.
which member borrowed what particular book at what date, etc.).

cboName is used to filter frmHistory by a member's name (for example,
if I choose "Aravind" from the list, frmHistory will be filtered to
display my borrowing habits). When I choose a name from the combo box
list, lblTitle will display the details of that particular member
(continuing from the example above, lblTitle will display my name,
I.D., MemType, and CourseFaculty). I use a macro (macro_cboName) to do
this:

--------------------------------------------------------------------------------
Action: OpenForm
Form Name: frmHistory
Where Condition: [MemName]=[Forms]![frmHistory].[cboName]

Action: SetValue
Item: [Forms]![frmHistory].[lblTitle].[Caption]
Expression: [Forms]![frmHistory].[cboName] & ", " &
[Forms]![frmHistory].[MemNo] & ", " & [Forms]![frmHistory].[MemType] &
", " & [Forms]![frmHistory].[CourseFaculty]

Action: SetValue
Item: [Forms]![frmHistory]![cboName]
Expression: Null
--------------------------------------------------------------------------------

The problem is that, if I choose a member name who doesn't have an
entry in History (and hence in qryHistory and frmHistory), lblTitle
will only display that member's name, whereas I want it to display
the details of that member (as in the examples above). How do I do
that? BTW, I'm using Access '97. Thank you.
Nov 13 '05 #1
1 1952
See comments inline...

On 8 Jul 2004 01:21:19 -0700, so**********@ho tmail.com (Aravind)
wrote:
Hi folks.

My database project has the following:

--------------------------------------------------------------------------------
tables:
Member: MemName, MemNo [PK], MemType, CourseFaculty
History: contains all of the above This doesn't look normalized. The only common field between the two
tables should be MemNo. MemNo the PK in the Member table should only
be the FK in the History table. Don't store the same information in
more than 1 place. This could be the cause of your ambiguity.

queries:
qryHistory: based on History This should be based on Member *and* History inner joined on MemNo.

forms:
frmHistory: based on qryHistory. MemNo, MemType and CourseFaculty is
not Enabled and not Visible. Also contains a combo box "cboName", and
a label "lblTitle".
--------------------------------------------------------------------------------

frmHistory is used to display the borrowing habits of members (i.e.
which member borrowed what particular book at what date, etc.).
This would be best as a form/subform. The parent form would hold the
Member info and the subform would hold the History info - borrowing,
etc.
cboName is used to filter frmHistory by a member's name (for example,
if I choose "Aravind" from the list, frmHistory will be filtered to
display my borrowing habits). When I choose a name from the combo box
list, lblTitle will display the details of that particular member
(continuing from the example above, lblTitle will display my name,
I.D., MemType, and CourseFaculty). I use a macro (macro_cboName) to do
this:
I would base the combo on a query of Member:
SELECT MemNo, MemName FROM Member

Set the columns to 2 the first would have a width of 0 (so you can't
see it) and the second to whatever you need. This way the MemNo is the
reference for the recordset. (In case you have more than one member
with the same name)

Use the combo box as the criteria of the form's RecordSource.
I don't do macros so I won't offer any suggestions; but I would use
the cboName AfterUpdate event to requery the form which would bring up
the Member info along with the History info in the subform.
--------------------------------------------------------------------------------
Action: OpenForm
Form Name: frmHistory
Where Condition: [MemName]=[Forms]![frmHistory].[cboName]

Action: SetValue
Item: [Forms]![frmHistory].[lblTitle].[Caption]
Expression: [Forms]![frmHistory].[cboName] & ", " &
[Forms]![frmHistory].[MemNo] & ", " & [Forms]![frmHistory].[MemType] &
", " & [Forms]![frmHistory].[CourseFaculty]

Action: SetValue
Item: [Forms]![frmHistory]![cboName]
Expression: Null
--------------------------------------------------------------------------------

The problem is that, if I choose a member name who doesn't have an
entry in History (and hence in qryHistory and frmHistory), lblTitle
will only display that member's name, whereas I want it to display
the details of that member (as in the examples above). How do I do
that? BTW, I'm using Access '97. Thank you.

I think approaching it along the lines mentioned above will solve this
problem along with other future problems.
- Jim
Nov 13 '05 #2

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

Similar topics

8
2892
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time it took to go to a record was very slow. The go to mechanism was a box that the user typed the index value into a combo box, with very simple code attached: with me.RecordsetClone .FindFirst " = " & me.cboGoTo If Not .NoMatch Then Me.Bookmark...
3
11106
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I have a primary form named TestResults, which is connected to data in a table named TestResults. There are basically two other tables that are related to the TestResults table (and the primary form) named Names-Normalized and SiteAddresses. The...
1
2214
by: Alex | last post by:
Acc97. I have a form which within a subform records machine down time. I have a total of 8 machines. (1-2-3 ect.) What I have been doing is using a combo box linked to the record table to select, the reasons based upon generic terms. The problem is that I have so many records now, that it takes more time looking and picking out the correct fault reason than it does completing the rest of the form!
2
5473
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would like to eventually be able to filter down through the tables untill i can reach one unique record. I am creating a datbase to keep track of registered accounts for a stae program. Each account is registered into the program through a two...
1
1885
by: MLH | last post by:
I have a form (xxxxxxxxxxxxxx) with a combo-box control (yyyyyyyyyyyyyy). The rowsource property for that combo box is as follows: SELECT DISTINCTROW ., . FROM ; The SQL for qryVehicleList is ... SELECT & " " & & " " & & " & "]" AS Vehicle, tblVehicleJobs.VehicleJobID, tblVehicleJobs.OwnerID, tblVehicleJobs.AuthID, tblVehicleJobs.TowJob,
1
3884
by: hackerslacker | last post by:
I have an ordering form that use two combo boxes to filter down the records of a Products table. This worked fine with the after_Update of the first filtering the records and creating the rowsource of the second combo. The second combo's control source is the Product ID field (foriegn key) on the Orders table. Everything worked well until I decided to enhance the form by changing the second combo to an option group. Now I don't know...
8
6417
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains the combo box. The fields I am working with are date fields that are formated as Short Date. I have written an IIF statement and placed it within the Criteria section of the Date field that I am trying to filter by. The current IIF statement works...
2
2633
by: Dev1 | last post by:
All- I'm new to this forum and i've been working with acces for about 2 days now. I have a form in which I have two combo boxes and depending on what is selected on the first dropdown the second one gets populated accordingly, which is great! There are two problems; First the when I select the value from the second drop down the value in the first and second combo box go away!! Second when I remove the filter the values for all the...
3
1813
by: flymo | last post by:
Hello All, I've bee trying out access 2007 and have a weird issue and would like to see if I'm issing something really basic. I have a form based on a query, I create a combo to look for records on my form based on Org_ID. Wgen I create all is fine - I type e, combo goes to e and starts filtering etc just like normal......I save the form, close the database and when I re-open the combo doesn't respond to any input - I can select a...
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10006
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
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 we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.