Error message in Dlookup

M

manish.amina

I have a master-detail form where the detail form has a field session
ID. The session ID refers a session Master table which has the fields
(Session ID, session start time (date/time), session End time
(date/time)).

I am using dlookup to fetch the start time & end time values for the
session ID into an unbound field. The values are fetched fine, except
that the New record always displays #Error until I choose a session ID.
My dlookup for the

=DLookUp(" [session master]![session end time]","[session
master]","[session master]![session id] = " & [session ID])

I suspect this has something to do with start & end times being
date/time field but I am not sure how to resolve this.

Regards
Manish
 
J

John Vinson

I have a master-detail form where the detail form has a field session
ID. The session ID refers a session Master table which has the fields
(Session ID, session start time (date/time), session End time
(date/time)).

I am using dlookup to fetch the start time & end time values for the
session ID into an unbound field. The values are fetched fine, except
that the New record always displays #Error until I choose a session ID.
My dlookup for the

=DLookUp(" [session master]![session end time]","[session
master]","[session master]![session id] = " & [session ID])

I suspect this has something to do with start & end times being
date/time field but I am not sure how to resolve this.

Regards
Manish

You might try checking for null values first:

=IIf(IsNull(Me![Session ID], Null, DLookUp(<your expression>))

John W. Vinson[MVP]
 

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

Top