I have a flat database that can contain multiple entries for an individual. It is a sign in sheet for company visitors. The first time they visit they must watch a Powerpoint Presentation then print a visitor badge with name, date, time, etc. The next time they visit they do NOT need to watch the presentation, just print the badge (as long as the presentation hasn't changed). I have most of this worked out with the exception of determining if they have saw the presentation before. I'm keying on FullName (which is FirstName concatenated with LastName). I also have a field called SlideShow that is initially "No" then changed to "Yes" after the pres. is watched.
My problem is if after the first visit when they input their First and last names and click on Sign In, I am generating FullName variable but I need to search the "Contacts" table for "FullName" and see if that records "Slideshow" field has been set to "Yes". If so, I will skip the pres and print a badge.
I have tried various forms of the DLookup.
Currently it is this:
dim varx as variant
strFullName as String
varx = DLookup("Slideshow]", "Contacts", [FullName] = StrFullName)
The "criteria" argument of DLookup has the same rules applied as an SQL "WHERE" clause. Strings need to be enclosed in quotes or Access thinks it's supposed to find a function or constant with the value specified.
Here's an example in reverse:
Say we want to find all records with a date matching today...