DLookup is found in the Visual Basic help, not the normal ACCESS help.
Open the Visual Basic Editor, type DLookup in the "Ask a Question" box at
top right of window, and press Enter.
--
Ken Snell
<MS ACCESS MVP>
"lynn atkinson" <(E-Mail Removed)> wrote in message
news:9E0C74E7-801D-4412-BAB3-(E-Mail Removed)...
>I would give that a go, but no matter what I enter in the help, I cannot
>find
> an explaination of the DLookup function. Any ideas how I find this?
>
> "Ken Snell [MVP]" wrote:
>
>> Assuming that you want to find the values for the fields (in rooms table)
>> from the table itself, you can use the DLookup function to get the value
>> from a field in a table or query. Take a look at Help info on it, and
>> then
>> post back if you need additional assistance; we'll be here!
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>> "lynn atkinson" <(E-Mail Removed)> wrote in message
>> news:2FEAA619-94DE-4E4A-9ACE-(E-Mail Removed)...
>> > thanks for your reply.
>> >
>> > Rooms is a table; room capacity and max participants are fields in the
>> > rooms
>> > table. text 1010 is a calculated control on the form. room capacity or
>> > max
>> > participants do not appear as controls on this particular form, but
>> > they
>> > do
>> > appear on another form, where the same calculation works ok., I assume
>> > because it is referring to controls that exist on that form.
>> >
>> > Not sure how I go about accessing the fields that are not in the
>> > current
>> > form.
>> >
>> > Is there any good reading you can recommend on this sort of thing?
>> >
>> >
>> >
>> > "Ken Snell [MVP]" wrote:
>> >
>> >> 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" <(E-Mail Removed)> wrote in
>> >> message
>> >> news:772CE141-D241-4EED-9814-(E-Mail Removed)...
>> >> >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 [MVP]" wrote:
>> >> >
>> >> >> 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>
>> >> >>
>> >> >>
>> >> >> "lynn atkinson" <(E-Mail Removed)> wrote in
>> >> >> message
>> >> >> news:B55626BA-CFC5-4474-A151-(E-Mail Removed)...
>> >> >> >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
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>
|