Error message in Dlookup

  • Thread starter Thread starter manish.amina
  • Start date Start date
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
 
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]
 
Back
Top