473,396 Members | 1,859 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.

Passing the value of Query Input to Form

4
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 user for the Month and their last name. The fields in the table being updated include: FY, Month, Employee ID, Task Number, hours. The query then displays the results in data sheet view on the form. I have been asked by users to display total they input for the month which I finally was able to do. However, one admin person asked that a control total be added for allowable hours per month so the employee could compare what they entered for a month to the control total. So, I created a control total table with 2 fields: Month and Control Total.

On the form I would like it to display the control total for the month the user input in activating the form. While the form displays the month requested, I cannot seem to get the form to display the value/month input by the user.

I tried creating a control in the form and tried to set the control source to the query that the form was based on. However, I had no luck, I either get a blank or name reference error. I also tried a lookup without sucess. Seems that once the query generates the form the month that was prompted for is no longer avialable. I am fairly new to this so patience and any suggestions are appreciated.
Oct 16 '06 #1
2 3973
Hi dath,
I imagine that from your info, you have a criteria in a query called [Month] that will pop up a message for them to enter a month. If I have this right then what you need to do is in the query, create a new column with the field set to SelMonth: [Month] and make sure Month is spelt the same. Tick on the Show check box. your query will now have a field called SelMonth which you can put on a form or use to join in a nother table with the value.

Option 1.
In the controlsource of a text box that you want to show the control total, put =DLookup("controlvalue","controltable","themonth=" & SelMonth)

Option 2
In the record source of the form, use this field to join between your query with SelMonth and the table with the control totals in.

Hope this helps.


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 user for the Month and their last name. The fields in the table being updated include: FY, Month, Employee ID, Task Number, hours. The query then displays the results in data sheet view on the form. I have been asked by users to display total they input for the month which I finally was able to do. However, one admin person asked that a control total be added for allowable hours per month so the employee could compare what they entered for a month to the control total. So, I created a control total table with 2 fields: Month and Control Total.

On the form I would like it to display the control total for the month the user input in activating the form. While the form displays the month requested, I cannot seem to get the form to display the value/month input by the user.

I tried creating a control in the form and tried to set the control source to the query that the form was based on. However, I had no luck, I either get a blank or name reference error. I also tried a lookup without sucess. Seems that once the query generates the form the month that was prompted for is no longer avialable. I am fairly new to this so patience and any suggestions are appreciated.
Oct 16 '06 #2
dath
4
Thanks it worked. It was such a simple solution. I guess I was making it more complicated than I needed to.

Dave
Oct 17 '06 #3

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

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
4
by: Joe | last post by:
I have wrote a script to query my mysql database based up a name that is selected from an HTML list menu, the form action calls to my php script from my html doc, I have tested connectivity to the...
3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
12
by: zig | last post by:
I've posted this on alt.comp.lang.coldfusion, but is predominantly a javascript problem: I have a CF query which returns several rows of records. I wanted to have a checkbox on each record of...
10
by: Joseph S. | last post by:
Hi, How do I pass a string from one call to a php block to another call in the same page but from another form? Here's my full php code: I'm using two forms in the same page. A hidden field...
6
by: JackM | last post by:
I have a multiple select input in a form that's being populated by a row from my database as such: <input type=\"checkbox\" name=\"subm\" value=\"$row\"> That part is working fine as I can check...
6
by: jej1216 | last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
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
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...
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...

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.