Error when using control source for textbox

hunterfan48

Registered User.
Local time
Yesterday, 21:21
Joined
Aug 17, 2008
Messages
436
I have a textbox that I would like to show data from its table. So, I go into properties for that textbox and go to 'control source.' I click the three lil dots and bring up the expression builder. From there, I go into the folders and select the correct table from which I will select the right field to match up with this text box.

However,
When I go back to regular form view, I keep seeing this.

#Name?

What's causing this to show instead of the actual text from the table?

Thanks,
Brady
 
Does the field that you are linking the Text box to reside in the same table that is the Record Source for your form? I'm guessing not, hence the #Name? error, so you will need to use the DLookup() Function to collect the data you are after
 
You are correct...now I need to figure out how to correctly type in that DLookup() function. Here goes nothing LOL
 
Ok...so how do I get these text boxes to update to the correct ID?? It keeps showing the same info on each record.

UPDATE:

Did some researching and it looks like I got it working although I don't think I understand it all. LOL

=DLookUp("[Address]","tblCustomers","[ID] =" & [Forms]![Form10]![ID])

First off, could somebody tell break it down real simple for me and tell me why brackets and parantheses are needed?

Also, I seen this example and tried to apply it to mine, but to double check, why do we have to put Forms first and then the actual name of my Form? Wouldn't it go to Form10 without that Forms part in front of it??

The last part is the name of a combo box I have on a tab in my main form.

Thanks for all your help guys...
 
Last edited:
You will need to choose something that links the current record to a related record in the second table.
 
You will need to choose something that links the current record to a related record in the second table.

See my edit to my previous post...is what I entered in as my control source for that text box the same thing as what you're referring me to do?
 
If you're having difficulty understanding what a function (such as a DLookup function) does, your first point of call is to look in the help files.

This link should help as well:

http://www.techonthenet.com/access/functions/domain/dlookup.php

I would advice you to add that website to your favourites as it lists a good number of functions that you will find useful in the future.

As for the square brackets, they are not need in your case. You need square brackets only when your field or table name has a space or a special character in it.

Also, this [Forms]![Form10]![ID] can also be just this [ID]. A full reference to the form is not needed unless you are calling a field in another form.

Finally, [Form10] is not a meaningful name for a form. Have a good naming convention going.
 
You're right and I do lookup info on other sites (the one you've mentioned I frequent a lot actually) before just coming and asking a question.

This isn't exactly easy stuff to learn though so that's why ask you guys (the experts) questions to help me understand more. I don't just try to use someone...I try to fully understand and ask questions to help me to fully understand that way I'm not just asking somebody to do it for me.

With the help I've received here, I'm a lot more advanced than when I first started. I appreciate everyone's help.
 
Finally, [Form10] is not a meaningful name for a form. Have a good naming convention going.

I will...it's just for practice on a backup copy right now to help me get it figured out 1st. I used a short and simple name just for practice purposes...
 
I will...it's just for practice on a backup copy right now to help me get it figured out 1st. I used a short and simple name just for practice purposes...
Just making sure you are following best practices ;)
 

Users who are viewing this thread

Back
Top Bottom