A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Less Than" Query Problem



 
 
Thread Tools Display Modes
  #1  
Old August 18th, 2005, 04:01 PM
JTF
external usenet poster
 
Posts: n/a
Default "Less Than" Query Problem

I have a form that contains a drop down list, from which the user can
select a "period" - from 1-13.

I have two update queries that I need to run based on what period the
user selects. In the first query, a field called Current Balance is
updated with the RevAmount field for the particular NCASperiod
selected. SQL code is below.

UPDATE NCAS SET NCAS.CurrentBalance = NCAS.RevAmount
WHERE (((NCAS.Period)=Forms![ComboBox for Report]!NCASPeriod));

This query works as it should.

The next query is basically the same. It should update a field called
PreviousBalance with the REVAMOUNT field, if the PERIOD field is less
than the NCASperiod selected from the drop down list.

UPDATE NCAS SET NCAS.PreviousBalance = NCAS.RevAmount
WHERE (((NCAS.Period)[Forms]![ComboBox for Report]![NCASPeriod]));

This query does not work at all. It continually asks me to type the
desired period.

Can someone tell me what I am missing here? I've looked at the SQL
over and over and am not seeing it.

many thanks!

  #2  
Old August 18th, 2005, 04:51 PM
mscertified
external usenet poster
 
Posts: n/a
Default

You need the form name in the SQL e.g. [Forms]![Formname]![Controlname]

Dorian

"JTF" wrote:

I have a form that contains a drop down list, from which the user can
select a "period" - from 1-13.

I have two update queries that I need to run based on what period the
user selects. In the first query, a field called Current Balance is
updated with the RevAmount field for the particular NCASperiod
selected. SQL code is below.

UPDATE NCAS SET NCAS.CurrentBalance = NCAS.RevAmount
WHERE (((NCAS.Period)=Forms![ComboBox for Report]!NCASPeriod));

This query works as it should.

The next query is basically the same. It should update a field called
PreviousBalance with the REVAMOUNT field, if the PERIOD field is less
than the NCASperiod selected from the drop down list.

UPDATE NCAS SET NCAS.PreviousBalance = NCAS.RevAmount
WHERE (((NCAS.Period)[Forms]![ComboBox for Report]![NCASPeriod]));

This query does not work at all. It continually asks me to type the
desired period.

Can someone tell me what I am missing here? I've looked at the SQL
over and over and am not seeing it.

many thanks!


  #3  
Old August 18th, 2005, 05:05 PM
JTF
external usenet poster
 
Posts: n/a
Default

ComboBox for Report is the name of the form....thanks....

  #4  
Old August 18th, 2005, 05:43 PM
JTF
external usenet poster
 
Posts: n/a
Default

All - I think I have this working now...much thanks.....

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query Problem jacob Running & Setting Up Queries 0 May 26th, 2005 09:46 PM
Annual count queries on a field relative to a value that varies DA tobesus General Discussion 7 May 10th, 2005 07:50 AM
Problem with query and table joins Chuck Mueller Running & Setting Up Queries 1 February 18th, 2005 04:08 PM
WORD XP mail-merge FAILS using ACCESS Query SueMackay Mailmerge 1 November 23rd, 2004 01:03 PM
Union Query Not Returning A Value Jeff G Running & Setting Up Queries 2 October 19th, 2004 05:47 PM


All times are GMT +1. The time now is 03:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.