Table Lookup combobox problem

A

ACAS

I have two tables. First table containe fields:

ID POGONI GAZOLIN
(Primary Key)

In second table I have two lookup combo boxes:

Pogon:

Row Source Type: Table/Query
Row Source SELECT POGONI.POGONI FROM POGONI

And

Gazolin:

Row Source Type: Table/Query
Row Source SELECT POGONI.Gazolin FROM POGONI

When I have updated field 'Gazolin' in Table 'POGONI' (First table), same
field ('Gazolin') in second table is not updated.

Example:

First table before update:

POGONI Gazolin
PPPPP 500

Second table before update:

POGONI Gazolin
PPPPP 500

First table after update:

POGONI Gazolin
PPPPP 700

Second table after update:

POGONI Gazolin
PPPPP 500

Best regards,
ACAS
 
J

John W. Vinson

I have two tables. First table containe fields:

ID POGONI GAZOLIN
(Primary Key)

In second table I have two lookup combo boxes:

That's a problem right there. See
http://www.mvps.org/access/lookupfields.htm
for a critique of what many of us consider a misfeature.
Pogon:

Row Source Type: Table/Query
Row Source SELECT POGONI.POGONI FROM POGONI

And

Gazolin:

Row Source Type: Table/Query
Row Source SELECT POGONI.Gazolin FROM POGONI

When I have updated field 'Gazolin' in Table 'POGONI' (First table), same
field ('Gazolin') in second table is not updated.

Sure. One of many limitations of using combo boxes in a Table (where they do
not belong) rather than on a Form (where they do). You can Requery a combo box
on a form in code (Forms!nameofform!nameofcombo.Requery) or in a macro, but
AFAIK you cannot do so in a table. If you press F9 to manually requery the
display you may be able to see the updated value.
 
M

Marshall Barton

ACAS said:
I have two tables. First table containe fields:

ID POGONI GAZOLIN
(Primary Key)

In second table I have two lookup combo boxes:

Pogon:

Row Source Type: Table/Query
Row Source SELECT POGONI.POGONI FROM POGONI

And

Gazolin:

Row Source Type: Table/Query
Row Source SELECT POGONI.Gazolin FROM POGONI

When I have updated field 'Gazolin' in Table 'POGONI' (First table), same
field ('Gazolin') in second table is not updated.

Example:

First table before update:

POGONI Gazolin
PPPPP 500

Second table before update:

POGONI Gazolin
PPPPP 500

First table after update:

POGONI Gazolin
PPPPP 700

Second table after update:

POGONI Gazolin
PPPPP 500


Well, the field's value in one table will never change just
because you change a value in another table.

What you are seeing is another manifestation of the evils of
using a Lookup Field in a table. See the second commandment
at http://www.mvps.org/access/tencommandments.htm

On the other hand, you can thoroughly fake yourself out by
using a more robust row source query:

SELECT POGONI, Gazolin FROM POGONI

with ColumnCount set to 2 and ColumnWidths to 0; (that's
zero and a semicolon)
 
A

ACAS

Teh problem is that I have query for report which use 'Gazolin' field from
second table. After I have updated 'Gazolin' in first table with inupt form I
have wrong(old) value from second table in report. I need second table
becouse 'Pogon' is duplicated like:

First table:
Pogon Gazolin
pp1 100

Second table:
Pogon Field Gazolin

pp1 ff1 100
pp1 ff2 100


Report design is :

Pogon:pp1

field production

f1 200
f2 300
f3 400

Gazolin: 100
Sum: 1000

how to resolve this problem?

Best regards,
ACAS
 
M

Marshall Barton

ACAS said:
Teh problem is that I have query for report which use 'Gazolin' field from
second table. After I have updated 'Gazolin' in first table with inupt form I
have wrong(old) value from second table in report. I need second table
becouse 'Pogon' is duplicated like:

First table:
Pogon Gazolin
pp1 100

Second table:
Pogon Field Gazolin

pp1 ff1 100
pp1 ff2 100


Report design is :

Pogon:pp1

field production

f1 200
f2 300
f3 400

Gazolin: 100
Sum: 1000

how to resolve this problem?


Once you get rid of those stupid Lookup fields, you can see
what's happening.

Do yourself and the rest of us a big favor and change the
Lookup fields from a combo box to a text box. If you then
open the second table you will see values (e.g. 100) when
you really need to have table1's PK value.

It should then be obvious that the report needs to be based
on a query that Joins the two tables to pull all the data
needed by the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top