If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Control Source from another table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2004
Posts: 39
Control Source from another table

I have a form and a textbox on it.
The control source of the textbox I want to be based on a SELECT statement from a specific table independently from the Recordsource of the form.
So, I've tried something like "=(SELECT Month FROM tblMonth WHERE ID=1)" into the textbox's Controlsource but I always get a #Name? error.
Any help will be apreciated!
Thx
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jan 2005
Location: United Arab Emirates
Posts: 23
Please have look DLookup Function in the VBA help file
Sample code given in the help file is below
=DLookup("[ProductName]", "Products", "[ProductID] =" _ & Forms![Order Details]!ProductID)hope this helps
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On