By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Display table record field in form

100+
P: 135
Hello

I have a table (BOM TOTAL L1 V1) created by a query which only contains one field (TCL1) with ONE record. I've been trying to display this record on a form (either in a textbox or a label) so i can them make some calculations with this number but i CANT!!!

I have tried different things and nothing.

I get error "#Name?" when entering =[BOM TOTAL L1 V1]![TCL1] on the unbounded textbox.

Should the textbox or label be BOUND??? UNBOUND???

Can it be done with any control property or has to be done by code???

Any other possible way arround it?

What im trying to do is to create a form where the user will enter some information (margin %, R&D costs, taxes, etc.) which will be used with the "TCL1" value in order to ger a TOTAL PRICE.

HELP!!!
Sep 13 '07 #1
Share this Question
Share on Google+
6 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try setting the control souce as follows:

=DLookup("[TCL1]","[BOM TOTAL L1 V1]")Keep the textbox unbound.
Sep 14 '07 #2

100+
P: 135
Try setting the control souce as follows:

=DLookup("[TCL1]","[BOM TOTAL L1 V1]")Keep the textbox unbound.
Thanks it works perfectly.

I just have a last question.

Does "[TCL1]" has to be stored in a TABLE??? (this is actually a make-table query result) can it find the record from just a query? so i dont have to create tables for every single field i need?

Also, can it find the value from a FORM (a calculated field) istead of a table?

Thanks again,
Gilberto
Sep 14 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
No you can use this code on a query. Just substitute the query name for the table name.
Sep 14 '07 #4

MGrowneyARSI
P: 90
as long a the value in the table will not change while you are in the form your working with I would sagest that you set a variable = to a Dlookup like Mary suggested do this in the on open event of the form and then just set the text box equal to the variable. The only resign for this step is so that you only run the Dlookup once; this will keep it from slowing down you app other than that you’re on the right track
Sep 14 '07 #5

100+
P: 135
Perfect. Thank you all for your help
Sep 14 '07 #6

MMcCarthy
Expert Mod 10K+
P: 14,534
Perfect. Thank you all for your help
You're welcome.
Sep 14 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.