473,406 Members | 2,377 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,406 software developers and data experts.

SQL Query in a Form Control

Expand|Select|Wrap|Line Numbers
  1. expr1:(SELECT employees.sku from employees where employees.id = [employee];)
This is a subquery sql statement.
Can I get this to work in a text box control in a form?
Employees is a table.
Labor is a table that looks up data from the employee table with this lookup query;
Expand|Select|Wrap|Line Numbers
  1. SELECT employees.ID, employees.name, employees.sku, employees.initials FROM employees; 
The Labor table is being shown in a subform that is filtered by a job number.
I want to show the employees.sku in the subform so it is printed with the rest of the form. I created a text box control that get the time difference from the labor.work_in_time and labor.work_out_time like this;
Expand|Select|Wrap|Line Numbers
  1. =(DateDiff("n",[work_in_time],[work_out_time])\60 & Format(DateDiff("n",[work_in_time],[work_out_time]) Mod 60,"\:00"))
I'm having trouble with getting a sql statement that works in a query to work in a form control. Is there some different syntax or something? Besides wrapping it in parentheses and putting an equals sign in front of it, I'm not sure what I'm missing.
Dec 26 '07 #1
2 1979
I tried making a query that gives me the needed data and using that as the record source for the sub form but a query doesn't allow you to add new records.
Dec 26 '07 #2
DLOOKUP ! YAY
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("sku","employees","ID = [employee]")
Dec 26 '07 #3

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

Similar topics

3
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the...
5
by: Ken Lindner | last post by:
We have a report based on a query that is called from a form. Nothing too special here. The query has 3 coulmns that are populated directly from values entered into entry fields on the form...
2
by: Seth Delaney | last post by:
I have a form with multiple unbound text boxes which serves as a "search form". I can enter my search parameters in the various boxes as needed and click okay. My records are then filtered to...
1
by: Joe.Mobley | last post by:
All, When you sell a product we require access to remove that information from the stock table, so the product is sold througha comobo box named "Combo4" under the prodcuts sold form which is a...
7
by: John | last post by:
I currently have a form and subform based on two tables; tblGoodsIn and tblGoodsInDetail. The fields in the underlying tables do not contain any price information. only foreign key links to...
2
by: | last post by:
Hi everyone, I have a form with a combo box on it. When you select a value (a PO#) from the combo box, the bound field is the indexID of the selected PO. On the same form, I have a text box...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
2
by: dath | last post by:
Hi, Searched the forum and found a lot on passing form input to aquery but not the other way around. Here is the situation: I have a timesheet form based on a subform query that asks the...
6
by: Phil Stanton | last post by:
I am running a query that calls a function used to format addresses depending on the width of a control on a report that shows that address. The same query is used as the RecordSource of lots of...
2
by: Coll | last post by:
I have a form and a query. I would like to have some control on the form (check box probably), that when selected will limit the criteria for a field in a query. Here are the details.... When...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.