Subform lookup

J

Justin

in my database, i have this subform where if the user selects one of the
items on from teh subform, it will bring them to another form with all the
selected data. what i did was
Forms![name of form]![name of subform].Form![name of the column from table]

for instances, im checking the batch # from teh subform so it will check all
infor for that batch #. I need to have it check batch # and another column
from my table

i tried to add "& [name of second column]" to the end of the statemetn, but
im getting a mistype error. please help
 
C

Chaim

'Forms![name of form]![name of subform].Form![name of the column from
table]' refers to a single property or member of an object, in this case the
field on the subform. It is not a text string, so you can't simply
concatenate another column name. If you need two columns, you need to repeat
this expression two times, substituting the second column name for the
'[name of the column from table]'. I'm assuming that the controls on the
subform are named the same as the columns in your table, otherwise, '[name
of the column from table]' wants to be the name of the control on the
subform.

Good Luck!
 
J

Justin

so basically, i should do Forms![name of form]![name of subform].Form![name
of the column from table] & Forms![name of form]![name of subform].Form![name
of the column from table]

Chaim said:
'Forms![name of form]![name of subform].Form![name of the column from
table]' refers to a single property or member of an object, in this case the
field on the subform. It is not a text string, so you can't simply
concatenate another column name. If you need two columns, you need to repeat
this expression two times, substituting the second column name for the
'[name of the column from table]'. I'm assuming that the controls on the
subform are named the same as the columns in your table, otherwise, '[name
of the column from table]' wants to be the name of the control on the
subform.

Good Luck!
--

Chaim


Justin said:
in my database, i have this subform where if the user selects one of the
items on from teh subform, it will bring them to another form with all the
selected data. what i did was
Forms![name of form]![name of subform].Form![name of the column from table]

for instances, im checking the batch # from teh subform so it will check all
infor for that batch #. I need to have it check batch # and another column
from my table

i tried to add "& [name of second column]" to the end of the statemetn, but
im getting a mistype error. please help
 
J

Justin

I just someway to have the data that is selected, Main thing is Batch # and
Amount
link up to table that is storing their value

I am having a problem when there are 2 batch that are the same but with 2
different values. It only selects the first one in the table.
That is why I even try to have 2 seperate 'Forms![name of form]![name of
subform].Form![name of the column fromtable]' and then have a command button
open the form where item is selected. unfor, whne i try to do a open form
command button, it is only letting me have one criteria. I want it so that
the command button opens the form and have 2 criterias. is there a way to do
that

Chaim said:
'Forms![name of form]![name of subform].Form![name of the column from
table]' refers to a single property or member of an object, in this case the
field on the subform. It is not a text string, so you can't simply
concatenate another column name. If you need two columns, you need to repeat
this expression two times, substituting the second column name for the
'[name of the column from table]'. I'm assuming that the controls on the
subform are named the same as the columns in your table, otherwise, '[name
of the column from table]' wants to be the name of the control on the
subform.

Good Luck!
--

Chaim


Justin said:
in my database, i have this subform where if the user selects one of the
items on from teh subform, it will bring them to another form with all the
selected data. what i did was
Forms![name of form]![name of subform].Form![name of the column from table]

for instances, im checking the batch # from teh subform so it will check all
infor for that batch #. I need to have it check batch # and another column
from my table

i tried to add "& [name of second column]" to the end of the statemetn, but
im getting a mistype error. please help
 
Top