> Thank you for the answer. Sorry, I just got back to work recently. So, I
> can't respond this answer before. I am sure I have the correct field with
> '_'
> (no space). And I always have the same problem when writing Dlookup VBA
> script with conditional. I just wrote the script like:
>
> SeatTable# = Me.Seating_Table_
> Me.TotalSeat = DCount("[Seating_table#]", "[Gala Activity]",
> "[SeatTable#]=
> [Seating_Table#]")
>
> And the same message came up "you cancelled the previous operation".
> Please
> help me to solve this problem. Thank you so much for your help.
> Rgds,
> KF
>
> Douglas J. Steele wrote:
>>I'm assuming that that's not your actual code, since the way it's
>>presented
>>certain isn't valid.
>>
>>The error message you're encountering will occur if you've got an
>>incorrect
>>field or table name in your DLookup statement. Are you positive that the
>>names of the fields are Start_Date and Program_Code (with underscores) and
>>not Start Date and Program Code (with spaces)? If there are spaces, my
>>advice would be to remove the spaces. If you cannot or will not, you need
>>to
>>put square brackets around them:
>>
>> stYTD = DLookup("[Start Date]", "[Projection]", _
>> "[Program Code] = " & prog)
>>
>>> Hi
>>>
>>[quoted text clipped - 26 lines]
>>> Rgds,
>>> KF
>
> --
> Message posted via AccessMonster.com
>
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200812/1>