Display data from 1 form in another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

At present I have 2 forms eg Form1 and Form2.
Form1 has 3 Fields 1 = Dip1 (A combo Box) where I can select my choice of
entry.
2 = Ltrs1 which holds litres of fuel remaining
3 = Ltrs2 which also holds litres of fuel
remaining.

Form2 has 2 fields 1 = Dip2 (A combo box )where I select my choice of entry.
2 = Ltrs2

Each are records for a separate fuel tank.
If I run Form1 to ask me to enter a Dip figure from a list where 2 lots of
fuel quantities are displayed, this is fine. I then set up the Combo box to
enter the required Dip figure from tank 2 (Form2) which is accepted then when
I want to display the Fuel remaining Ltrs2 I get the #Name? message in the
unbound text box. Can anyone help and explain why.

The expression I put in the text box to display the required Ltrs2 quantity is

=[Forms]![Form2]![Ltrs2]

This I presume should work.....I would appreciate any assistance with this
problem as it has now wrecked my head for several days..


regards

Les C
 
Hi

At present I have 2 forms eg Form1 and Form2.
Form1 has 3 Fields 1 = Dip1 (A combo Box) where I can select my choice of
entry.

You're making the very common but incorrect assumption that data is
stored in Forms. It's not. A Form is just a window, a tool to let you
update data in a Table.

Use the Table to which Form2 is bound rather than trying to get your
data from Form2.

John W. Vinson[MVP]
 
Hi John...

I have tried to use an expression to get the value that I require from a
table but to no avail...I still get the same message #Name?

The expression to the actual table that I require data from is as follows

Actual table name is Table2 and it holds 2 fields Tank2Dip and Tank2Ltrs and
I require data from the Tank2Ltrs field...

text box expression is =
![Tank2]![Tank2Ltrs] but I still get the
same message #Name?

Any help would be greatly appreciated


Les
 
Hi John...

I have tried to use an expression to get the value that I require from a
table but to no avail...I still get the same message #Name?

The expression to the actual table that I require data from is as follows

Actual table name is Table2 and it holds 2 fields Tank2Dip and Tank2Ltrs and
I require data from the Tank2Ltrs field...

text box expression is =
![Tank2]![Tank2Ltrs] but I still get the
same message #Name?

Any help would be greatly appreciated


There is no such thing as
! in Access syntax. It's simply not
part of the language, and I have no idea where you got it.

Table Table2 (or Tank2??? which is it?) might have any number of
records. Which record in Tank2 do you want to read?

Try

=DLookUp("[Tank2Ltrs]", "[Tank2]", <optional criteria>)

to find a record in Tank2 using the criteria (which I don't have any
idea about); if you don't specify criteria, you'll get the value of
Tank2Ltrs from the first record in the table in disk storage order.

John W. Vinson[MVP]
 
Hi John

Thanks very much for your help and it works but I need a little further
assistance if you can help....
My project is

I have 2 fuel tanks and I want to be able to display the remaining fuel
quantities in my tanks on the same Form.I can now display Tank2 quantity but
it is only the last record.

My aim is to select a Dip figure ie 1.2.4 ( Which means 1ft 2Inch and 4
10ths )
from a combo box and display the corresponding fuel figure in a box .

I have 2 tables Table1 and Table2 and 1 Form called FormTanks and I am fine
with data from Tank1 but Tank2 is difficult.

My table is Tank2 and it contains two fields Tank2Dip and Tank2Ltrs which
contain the Dip figure and The amount of Litres remaining and I need to be
able to display the corresponding Litres from the Dip figure that I select
from the combo box...

Any further help would be great.....

Thanks for sparing the time to help me.

Regards

Les

John Vinson said:
Hi John...

I have tried to use an expression to get the value that I require from a
table but to no avail...I still get the same message #Name?

The expression to the actual table that I require data from is as follows

Actual table name is Table2 and it holds 2 fields Tank2Dip and Tank2Ltrs and
I require data from the Tank2Ltrs field...

text box expression is =
![Tank2]![Tank2Ltrs] but I still get the
same message #Name?

Any help would be greatly appreciated


There is no such thing as
! in Access syntax. It's simply not
part of the language, and I have no idea where you got it.

Table Table2 (or Tank2??? which is it?) might have any number of
records. Which record in Tank2 do you want to read?

Try

=DLookUp("[Tank2Ltrs]", "[Tank2]", <optional criteria>)

to find a record in Tank2 using the criteria (which I don't have any
idea about); if you don't specify criteria, you'll get the value of
Tank2Ltrs from the first record in the table in disk storage order.

John W. Vinson[MVP]
 
Back
Top