"Less Than" Query Problem

  • Thread starter Thread starter JTF
  • Start date Start date
J

JTF

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!
 
You need the form name in the SQL e.g. [Forms]![Formname]![Controlname]

Dorian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Update query 2
New Query 2
Update query 4
Trying to query off of a table field name 3
Combine Duplicates in Query 0
Access 2007 - check for existing record 1
Problem with query 2
Why it deletes my query? 2

Back
Top