Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

Select Data from subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daveo - 03 Aug 2005 05:11 GMT
Hi there,

I'm trying to select some data from a subform and display it in a text
box on my main form.

The fields in my subform are:

employee
site
dateFrom
dateTo
desk
PC

The main form is called "frmCairnsOfficeTester" and the subform is
called "frmSpaceTester"

I want to display the employee who is sitting at desk 1 in the text box
and so put the following as the control source in the text box:

SELECT frmSpaceTester.[employee] FROM frmSpaceTester WHERE
((frmSpaceTester.[desk]="Desk 1"));

All I get in the text box is #Name?. I know I'm doing something wrong -
does anyone know what it is?

Many thanks - David
Allen Browne - 03 Aug 2005 09:39 GMT
You cannot use a SQL statement as the Control Source for a text box.

You could use DLookup() to read the value from the table, e.g.:
=DLookup("Employee", "tblSpaceTester", "Desk=""Desk 1""")

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi there,
>
[quoted text clipped - 23 lines]
>
> Many thanks - David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.