473,405 Members | 2,344 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,405 software developers and data experts.

Tables Queries Criteria oh my!

I have built a database to keep a track of the various items in our
works inventory. To keep track of this information I have a number of
tables, obviously.. they are as follows:

Product Info:-- This holds all the information about the actual
product, for instance the name of it (lipstick for example) who
invented it, what its properties are

Batches Made:-- This is where we store the information about each batch
of the product. It has infor like when it was made, how much was made
and the like
Items made:-- This is where we record that we have turned bulk lipstick
into actual lipstick samples. It records when we made the samples and
how many we make from each batch of bulk

Transactions Out-- This is where we store the information about the
samples we send out to customers. It records how many samples we send,
when we sent them, who we sent them to and so on..
Now, everything is working fine except for ONE query. It is a query
that enables you to see what Transactions Out have been performed on a
particular Product. I have built it as a query with a criteria that
gets its information from a combobox on a form. The combobox gets its
available data directly from the Product Info table. However.. the
query only seems to accept the criteria if one particular product is
chosen in the combobox. If you select that product (which is product ID
1) it works and shows you all the transactions that have been performed
on that particular lipstick. However, if you select a different product
in the combobox, the query refuses to give any results and claims that
the criteria is not being met at all. BUT, if you delete the criteria
completely, then it happily brings up a list of ALL the transactions
for all the products. Why is this happenning?

Cheers for any help you may be able to give...

Nov 13 '05 #1
2 1292

Do*******@gmail.com wrote:
I have built a database to keep a track of the various items in our
works inventory. To keep track of this information I have a number of
tables, obviously.. they are as follows:

Product Info:-- This holds all the information about the actual
product, for instance the name of it (lipstick for example) who
invented it, what its properties are

Batches Made:-- This is where we store the information about each batch
of the product. It has infor like when it was made, how much was made
and the like
Items made:-- This is where we record that we have turned bulk lipstick
into actual lipstick samples. It records when we made the samples and
how many we make from each batch of bulk

Transactions Out-- This is where we store the information about the
samples we send out to customers. It records how many samples we send,
when we sent them, who we sent them to and so on..
Now, everything is working fine except for ONE query. It is a query
that enables you to see what Transactions Out have been performed on a
particular Product. I have built it as a query with a criteria that
gets its information from a combobox on a form. The combobox gets its
available data directly from the Product Info table. However.. the
query only seems to accept the criteria if one particular product is
chosen in the combobox. If you select that product (which is product ID
1) it works and shows you all the transactions that have been performed
on that particular lipstick. However, if you select a different product
in the combobox, the query refuses to give any results and claims that
the criteria is not being met at all. BUT, if you delete the criteria
completely, then it happily brings up a list of ALL the transactions
for all the products. Why is this happenning?

Cheers for any help you may be able to give...


OK.. I have fixed the query.. the query now reads the value from the
combobox fine.. however, the form that is populated from the Query is
still not working, it will only show results if the Product selected is
the first one. However, the query is showing the correct results with
ANY product selected..

Nov 13 '05 #2
Do*******@gmail.com wrote:
OK.. I have fixed the query.. the query now reads the value from the
combobox fine.. however, the form that is populated from the Query is
still not working, it will only show results if the Product selected is
the first one. However, the query is showing the correct results with
ANY product selected..


Your form has a record source which is only populated when the form is
initially opened. I'm assuming you want things such that when the combo
box is changed, the records shown on the form will change. To do this
you need to "requery" the form. This requires some coding, which is
relatively simple to do, if you've not done any VBA coding before.

In the design view of the form that contains the combo box, you need to
have the combo box perform a "requery" on the form in question whenever
the combo box value is changed or _updated_.

Click on the combo box and make sure the properties window is displayed
(if it is not, you can click View->Properties or press alt-enter). The
title bar of the properties window will read something like: "Combo Box:
MyComboName", indicating the name of the cmobo box in question.

Click the event tab.

Put your cursor in the After Update event and click the little build
button that appears at the right.

A "Choose Builder" pop up window appears. Select "Code Builder" and
press OK.

The Micorosft Visual Basic editor window will open and you'll be at
something that looks like:

Private Sub MyComboName_AfterUpdate()

End Sub

You'll want to do one of two things. If the combo box is on the same
form as the one in which the records appear, do this:

Private Sub MyComboName_AfterUpdate()

Me.Requery

End Sub

If the form with the records is on a different form from that of the
combo box, do this:

Private Sub MyComboName_AfterUpdate()

Forms!frmMyFormName.Requery

End Sub

Save it and you'll find things work the way you want them to.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3

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

Similar topics

5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
2
by: Tim Pollard | last post by:
Hi I'm hoping someone can help me with an access problem I just can't get my head around. I normally use access as a back end for asp pages, just to hold data in tables, so queries within access...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
3
by: jgscott3 | last post by:
I have a number of queries that require various parameters. However, the parameters will change infrequently, so I do not want the user to have to respond to them every time they run the queries. ...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
14
by: Patrick A | last post by:
All, I have an Access DB. On a nightly basis, I want to look at an Other DB (not Access, but SQL) and: + Add any new records from Other.Clients into Access.Clients Is this something I...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
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...
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
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.