What is rooms -- a query? a table? Are the room capacity and other "fields"
the names of fields in your form's recordsource? or the name of controls on
the form?
If rooms is the name of a table or query, you don't use ! operator between
it and its field, you would use the . operator. However, a table or a query
are not avaiable for "direct" reading in this manner; the query or table
must be accessed by a recordset, by a domain function (DLookup, DCount,
DSum, etc.), by binding a form to an SQL statement that is based on the
table or query and then reference the fields from the form's recordsource,
etc.
Assuming that room capacity, etc. are controls or fields in the form:
=IIf(IsNull([room capacity]),[max participants]-[text1010],IIf([room
capacity]<[max participants],([room capacity]-[text1010]),([max
participants]-[Text1010])))
--
Ken Snell
<MS ACCESS MVP>
lynn atkinson said:
I am trying to calculate the number of places available on a course.
The calculation which throws up the error is as follows
=IIf(IsNull([rooms]![room capacity]),[rooms]![max
participants]-[text1010],IIf([rooms]![room capacity]<[rooms]![max
participants],([rooms]![room capacity]-[text1010]),([rooms]![max
participants]-[Text1010])))
if the field 'room capacity' has no data in it, then use the max
participants field minus the text1010 (which is places already booked) to
give the number of places still available. none of these controls except
text1010 are displayed on this sub form which is why I have tried to refer
to
the table eg table=rooms, field=room capacity.
hope this makes sense!
Ken Snell said:
It means that some part of your code or the setting for an event property
is
telling ACCESS to go look for a table or query or control or some other
object named "rooms".
Can you give us more details?
--
Ken Snell
<MS ACCESS MVP>
I am getting the error message as follows
the Object doesnt contain the automation object 'rooms'.....
what does this mean. I am trying to create an IIF statement, nothing
fancy,
but am getting this. Could someone explain
thanks
Lynn