Value from a table show on rpt

S

SoggyCashew

Hello I have a report that is unbound and Im using something like:
=Forms!AccidentEntry!AccidentEntrySubform.Form!ID
in each control source. Anyway I have a text boxes that have to have a name
from a table named tblPlantInfo. The field in this table is named PM. How can
I write a function to retrieve what is tin the tables field named PM so I can
put int in the control source on my report. Thanks!
 
J

John W. Vinson

Hello I have a report that is unbound and Im using something like:
=Forms!AccidentEntry!AccidentEntrySubform.Form!ID
in each control source. Anyway I have a text boxes that have to have a name
from a table named tblPlantInfo. The field in this table is named PM. How can
I write a function to retrieve what is tin the tables field named PM so I can
put int in the control source on my report. Thanks!

Just guessing here...

=DLookUp("PM", "[tblPlantInfo]", "[ID] = " &
Forms!AccidentEntry!AccidentEntrySubform.Form!ID)
 
S

SoggyCashew

Thanks for the reply John! I got it with =DLookUp("
","tblPlantInfo")
--
Thanks,
Chad


John W. Vinson said:
Hello I have a report that is unbound and Im using something like:
=Forms!AccidentEntry!AccidentEntrySubform.Form!ID
in each control source. Anyway I have a text boxes that have to have a name
from a table named tblPlantInfo. The field in this table is named PM. How can
I write a function to retrieve what is tin the tables field named PM so I can
put int in the control source on my report. Thanks!

Just guessing here...

=DLookUp("PM", "[tblPlantInfo]", "[ID] = " &
Forms!AccidentEntry!AccidentEntrySubform.Form!ID)
 
J

John W. Vinson

Thanks for the reply John! I got it with =DLookUp("
","tblPlantInfo")



This will find the first (actually an arbitrary) record from tblPlantInfo
unless you add a criterion as a third argument. If that's what you want,
fine...
 

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