473,399 Members | 3,919 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,399 software developers and data experts.

Please Help Passing Variable from Form to Query

MX1
HELP!

I have a query that gets a few values from a form. The problem I'm having
is a date field in the query. When I put the value in the criteria, it
works fine. When I put the same value as an item in a combo box of the form
and try to pass the value, I get "This expression is typed incorrectly or
too complicated to be evaluated".

Here it is:

'6/30/' & Str(Year(Now()))

The options in the row source of the combo box are as follows:

"January";"'6/30/' & str(year(now)))";"July";"12/31/' & str(year(now)))"

Is my formatting incorrect? I get the same thing when trying to pass "0 or
1" to denote both yes and no values of a checkbox. It doesn't like the word
OR. Any thoughts would be GREATLY appreciated as always. Thanks!
Nov 12 '05 #1
2 2039
You'll have to be more explicit about how you are "passing the value" from
the combo for anyone to provide useful suggestions. For what purpose are you
using the query? If it is as to select records for display in a form or
report, perhaps there's a better way to handle it.

Larry Linson
Microsoft Access MVP

"MX1" <mx*@mx1.abc> wrote in message
news:6XHEb.153035$_M.725952@attbi_s54...
HELP!

I have a query that gets a few values from a form. The problem I'm having
is a date field in the query. When I put the value in the criteria, it
works fine. When I put the same value as an item in a combo box of the form and try to pass the value, I get "This expression is typed incorrectly or
too complicated to be evaluated".

Here it is:

'6/30/' & Str(Year(Now()))

The options in the row source of the combo box are as follows:

"January";"'6/30/' & str(year(now)))";"July";"12/31/' & str(year(now)))"

Is my formatting incorrect? I get the same thing when trying to pass "0 or 1" to denote both yes and no values of a checkbox. It doesn't like the word OR. Any thoughts would be GREATLY appreciated as always. Thanks!

Nov 12 '05 #2
Hi,

On Fri, 19 Dec 2003 19:02:26 GMT, MX1 wrote:
I have a query that gets a few values from a form. The problem I'm having
is a date field in the query. When I put the value in the criteria, it
works fine. When I put the same value as an item in a combo box of the form
and try to pass the value, I get "This expression is typed incorrectly or
too complicated to be evaluated".

Here it is:

'6/30/' & Str(Year(Now()))

The options in the row source of the combo box are as follows:

"January";"'6/30/' & str(year(now)))";"July";"12/31/' & str(year(now)))"

Is my formatting incorrect? I get the same thing when trying to pass "0 or
1" to denote both yes and no values of a checkbox. It doesn't like the word
OR. Any thoughts would be GREATLY appreciated as always. Thanks!


two things: when working with dates, assure they're converted right. When
using expressions that are being "pulled" from a query, use the
eval-function around your expression there.
I.e. in your query, it should work with your value-list like this:

SELECT eval("cdate(forms!YourForm!YourCombo!column(1))") AS something, ...

The above will require a valid date though - you'll either have to assure
that from the form (which it would be with the string you create) or from
within the query with i.e. nz (slowing down the process).

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
4
by: Bob | last post by:
Hallo, I have to make a web application in Javascript/ASP for tenniscourt reservation (based on Access database). I would like to do everything with one page, because the user must be able to...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
0
by: Omar K | last post by:
Hi, I am quite new to frontpage and SQL but I have a Stock Control access database / frontpage to set up. My last problem deals with the automatic updating of the total quantity of stock with parts...
2
by: Chris | last post by:
I have two forms. From form one I have a listbox that when double clicked I get the selected value (string) and store in a variable. I parse the string to get the first 12 characters and store it...
2
by: Bob Sanderson | last post by:
I have a search form from which I hope to be able to select a record by field JobNumber and display it with an output form titled test.php <html> <head> <title>Job Database Search</title>...
11
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result =...
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
5
by: RacerX2000 | last post by:
I have an MS access Database (2000) and Have created a form that sets a variable to a value I would like (Based on other selections in the form) to pass to my query criteria and I get the following...
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
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
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
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
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
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...

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.