Multiple ID confusion

daffelito

New member
Local time
Today, 22:56
Joined
Sep 6, 2008
Messages
8
Hi.
I use a form to display data of a table that contains information about the Product "tblProduct".
I also have a table "tblVoltage" that shows wich types of voltage that a product can be runned on.
And when i use a Query it displays the same product the same number of time as there is different voltage for that product.

Let´s say that the product with ID 66 can be runned on 4 different types of voltage then the form shows that product 4 times. And i want it to show the product 1 time but with a listbox that shows 4 differnt voltages.
Im trying to build different queries, but i cant get it right.
Can someone help me?

I´m using Access 2000
 
The record source for the form should be based on tblProduct. Your combo box should get the voltages for the product currently dispayed on the form. Another approach would be the use of a subform displaying all voltages for that product. It will ultimately depend on what you want to do.
 
The problem is that i dont have any what so ever information in the tblProduct that is about voltage. So if i set the forms record source to tblProduct and creates a unbound listbox with the rowsource of whats in tblVoltage i get nothing.
Actually it´s showing everything thats in that table, but not the voltage for the Product from the tblProduct
 
The query for your listbox should be something like

SELECT <voltage_field> FROM tblVoltage where tblVoltage.ID = [<textbox_id>] (the textbox that has the product ID)
 
Do you get any error? The query goes in the Row Source. You will need to add a "Me.Requery" in the After_Update event for th textbox that has the product ID
 
It worked. It was because the first product to be displayed does not got any voltage, it´s a dummy, but when i added the requery in the after update event it worked lika a charm. Thanks!
 

Users who are viewing this thread

Back
Top Bottom