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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"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
|
|||
|
|||
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
|
|||
|
|||
ComboBox for Report is the name of the form....thanks....
|
#4
|
|||
|
|||
All - I think I have this working now...much thanks.....
|
Thread Tools | |
Display Modes | |
|
|
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 |