473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with SQL statement getting value from query

91
I have the following SQL statement in a text boxes control source.
Expand|Select|Wrap|Line Numbers
  1. SELECT SumOfHours FROM qryHoursPerOrder WHERE OrderID =  [OrderID]
The query is a 2-row table with OrderID's on one side and SumOfHours on the right. I just need to return the SumOfHours for that order. I get a warning/error on the form: Invalid control property.

Is there something I am missing?
May 26 '10 #1
2 1312
Megalog
378 Expert 256MB
If OrderID is purely numeric Then use:
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[SumOfHours]","qryHoursPerOrder","[OrderID] = " & [OrderID])
Else
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("[SumOfHours]","qryHoursPerOrder","[OrderID] = '" & [OrderID] & "'")
End Help
May 26 '10 #2
matt753
91
Thanks that worked, I never thought to use DLoookup for some reason I was just trying SQL
May 26 '10 #3

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

Similar topics

3
by: Richard | last post by:
I have written a static method that uses the Reflection API to scrape all of the names of the instance variables in a class and their corresponding values; and then returns a hashMap containing a...
4
by: wallacej | last post by:
I am trying to retrieve a selected value from a listbox and store it in a string (char) variable. I am using the following code: calibIndex=SendMessage(hWnd,(UINT)IDC_LIST_CALIBOPTS,(WPARAM)0,...
3
by: Jim | last post by:
I'm having a problem with a date query..im trying to pull customer data based on a date specified from a form to 3 months prior to the date specified. So lets say in the form I specified 1/2/2004....
5
by: velu | last post by:
Problem in getting value from textbox & radiobuttonlist to a valuable inside a datagid. I want to insert a record into a table thru datagrid. Here is the code (see below) Private Sub...
1
by: chitara | last post by:
is there any posibility to block mysql port or someting? I am getting "Error ,query failed" during adding any data through the admin panel of that website:-( same softwares(php, mysql and IIS)...
6
by: TSIGOS1 | last post by:
Hello, I have created a query in Access and I want to be able to read the sql statement of the query using vba and then run it from excel vba. That is instead of copying and pasting all the query...
1
coolv
by: coolv | last post by:
Hello everyone, I m generating dynamic textbox depending on the value selected from the dropdownlist(DropDownList1_SelectedIndexChanged).eg: if i select 3 from dropdownlist,then 3 textbox...
2
by: de_ja | last post by:
Hi, If, for example an access database that concerns insurance claim investigations. The database comprises only one table containing data - investigation reference number, referral date,...
3
by: vtpvp82 | last post by:
I am having problem in getting response from remote server for that I have written following script response got correctly but the data on the page is not displayed it gives “–“ in place of grid...
3
by: ganihskmca | last post by:
The following are the program i did...... and the problem im getting is object expected in onchange function at line 27(where i marked that one in bold for ur ease of identifying the error occuring...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.