Thank you everyone for your help and advise!
I think I somewhat understand your statement about VBA and control source. .
..possibly. My expression is located in the “default value” of a text box on
[SubFrm Actual] whose source is [Tbl Actual] so I’m not using VBA though I
tried three expressions below anyways.
This one returns the first time at the top of the field.
=DLookUp("[Start Time]","[Tbl Vol Opportunities]")
This one returns: #Name?
=DLookUp("[Start Time]","[Tbl Vol Opportunities]", "[Event ID] = "&
Me.[Event ID])
This one returns: #Error
=DLookUp("[Start Time]","[Tbl Vol Opportunities]", "[Event ID] = "& [Event
ID])
"BruceM via AccessMonster.com" wrote:
> The Me. prefix works only in VBA. The = sign suggests a Control Source
> expression. Given the inconsistencies in the original posting it is possible
> it is a fragment from VBA, but if it is a Control Source the Me. needs to be
> dropped.
>
> Daryl S wrote:
> >Flopbot -
> >You need to be exact in your naming of fields, tables, controls, etc. Any
> >field/table/control name that has any special characters (including spaces)
> >or are reserved words needs to be enclosed in square brackets. You were not
> >consistent in your posting, so I am using names that might not be correct.
> >This assumes the table name is "Tbl Opportunities", and that table has at
> >least two fields - "Start Time" and "Event ID". It also assumes that you
> >have a control (maybe a text box) called "Event ID" that has the event id you
> >want the start time for. If so, this is what you need:
> >
> >=DLookUp("[Start Time]","[Tbl Opportunities]", "[Event ID] = " & Me.[Event
> >ID])
> >
> >You also had one set of the double-quotes that were the right- and
> >left-sided ones which are no good in Access. You may have gotten those if
> >you were editing in Microsoft Word or something. You need the " rather than
> >“ or ” for your code to work.
> >
|