473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

#name? error in form using sql expression...

15 New Member
Hi

I'm having what i would guess is a really trivial problem. i have searched the forum but nothing can solve my problem: here is my sql code that goes into a edit box control:

SELECT targetFromVenueActivity.target
FROM venues INNER JOIN (Activities INNER JOIN targetFromVenueActivity ON Activities.ActivitiesID=targetFromVenueActivity.ac tivityID) ON venues.venue=targetFromVenueActivity.venueID
WHERE (((targetFromVenueActivity.venueID)=Forms![shift viewer]!venueID) And ((targetFromVenueActivity.activityID)=Forms![shift viewer]!activityID));

the query view of this works fine, but in the form i get #name? - what 2 do?
Jan 12 '07 #1
6 2189
willakawill
1,646 Top Contributor
Hi

I'm having what i would guess is a really trivial problem. i have searched the forum but nothing can solve my problem: here is my sql code that goes into a edit box control:

SELECT targetFromVenueActivity.target
FROM venues INNER JOIN (Activities INNER JOIN targetFromVenueActivity ON Activities.ActivitiesID=targetFromVenueActivity.ac tivityID) ON venues.venue=targetFromVenueActivity.venueID
WHERE (((targetFromVenueActivity.venueID)=Forms![shift viewer]!venueID) And ((targetFromVenueActivity.activityID)=Forms![shift viewer]!activityID));

the query view of this works fine, but in the form i get #name? - what 2 do?
Hi. There are a couple of things about this that stand out. What is most important is this;
"the query view of this works fine"
Have you pasted this syntax from a query view and added in the form fields?
Have you put this expression into an edit box control and then use it to submit to access?
Jan 12 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi

I'm having what i would guess is a really trivial problem. i have searched the forum but nothing can solve my problem: here is my sql code that goes into a edit box control:

SELECT targetFromVenueActivity.target
FROM venues INNER JOIN (Activities INNER JOIN targetFromVenueActivity ON Activities.ActivitiesID=targetFromVenueActivity.ac tivityID) ON venues.venue=targetFromVenueActivity.venueID
WHERE (((targetFromVenueActivity.venueID)=Forms![shift viewer]!venueID) And ((targetFromVenueActivity.activityID)=Forms![shift viewer]!activityID));

the query view of this works fine, but in the form i get #name? - what 2 do?
Are you trying to put this query into the control source of a textbox?

If so, is 'shift viewer' the form that the textbox is on?

Mary
Jan 12 '07 #3
anansi
15 New Member
Have you pasted this syntax from a query view and added in the form fields?
Have you put this expression into an edit box control and then use it to submit to access?
Yes, I have a form called Shift Viewer containing a control called Text42. I created a separate query that returns the value (a single value and a single record).
When looking at this query in the query's datasheet view (access 2007) it works, the result is not #name?. So looking at this query in its "SQL view" showed the SQL statement for it. I copied and pasted this into Text42's control

but the control shows #name? ...
Jan 13 '07 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
Yes, I have a form called Shift Viewer containing a control called Text42. I created a separate query that returns the value (a single value and a single record).
You can't use a query in a control source in this way. You will need to replace it with a DLookup function as follows:

Expand|Select|Wrap|Line Numbers
  1. =DLookup("[target]","targetFromVenueActivity","[venueID]=" & [venueID] & " And [activityID]=" & [activityID])
  2.  
Jan 13 '07 #5
anansi
15 New Member
You can't use a query in a control source in this way. You will need to replace it with a DLookup function as follows:

Expand|Select|Wrap|Line Numbers
  1. =DLookup("[target]","targetFromVenueActivity","[venueID]=" & [venueID] & " And [activityID]=" & [activityID])
  2.  

You are a legend. thank you
Jan 13 '07 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP
You are a legend. thank you
No problem.
Jan 13 '07 #7

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

Similar topics

29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
2
by: Aloof | last post by:
Using Access 2000 Windows Server 2003 The following code worked fine until we moved hosting companies StartDate = Request.Form("StartDateMonth") & "/" & Request.Form ("StartDateDay") & "/" &...
11
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html>...
7
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+...
0
by: Jeff | last post by:
Hey all, Unless I'm being a complete schmuck and missing something obvious, this is one of the strangest problems I've experienced in my 10 years of programming Access. I seem to be unable to...
2
by: Gerry Abbott | last post by:
Hi all. Im using abbreviated field names on a form to optimise space, but would like to display for example, the status bar text of the control, onto the form header, when the control has the...
1
by: Carlos Kim via DotNetMonster.com | last post by:
Compiler Error Message: CS1026: ) expected Source Error: Line 12: <body MS_POSITIONING="GridLayout"> Line 13: <form id="Form1" method="post" runat="server"> Line 14:...
31
by: Peter Michaux | last post by:
Hi, I want to know the name of an object's constructor function as a string. Something like this <script type="text/javascript"> function Foo(){}; var a = new Foo(); alert('"' +...
12
by: -Lost | last post by:
What in the world is functionName.name good for? That is: function functionName() { return functionName.name; } I mean, I already had to write out the function's name so it seems that it is...
17
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.