Well, now you know why it is a bad idea to use NAME as the name of anything in
Access. Every object has a name property. You must disambiguate what you are
referring to. Also, in your case you need the field name in the table.
PERHAPS the following might work, but I'm not sure you can use VBA functions
inside a DCount function
If DCount("*", "Stress Tbl",
"Left([Name], 1) & Right([Name], Len([Name]) - InStr(1, [Name], "" "")) =" &
Chr(34) & CurrentUser() & Chr(34)) = 0 Then
Try it. If that still doesn't work, post back again.
Daniel P wrote:
>
> John,
>
> I fixed one issue with the following mod to your original code:
>
> If DCount("*", "Stress Tbl", Left([Name], 1) & Right([Name], Len([Name]) - InStr(1, [Name], " ")) & "=" & CurrentUser() & "") = 0 Then
>
> but when it gets run the [Name] value is not that of the names in my table but rather the name of the subform form where the event occurs?! I'm confused the second section of the DCount function clearly states to use the "Stress Tbl"....
>
> Any Ideas?
>
> Daniel
|