From: Andrew Thorpe on 21 Apr 2010 13:56 I have a table that includes a field StartDate. Another table (HOLIDAY) holds dates announced as Holidays. I am trying to use the Lookup function to see if my StartDate matches a HolidayDate. I have tried If Forms!frmAssignment!StartDate = DLookup("HolDate", "HOLIDAY", "HolDate = " & Me.StartDate) Then......... Unfortunately, it doesn't run!! (The datatypes throughout are ShortDate). I've tried the same using the # sign as part of the last section, but still no joy. Would appreciate any help. Thank you. Andrew
From: Beetle on 21 Apr 2010 14:43 The correct syntax should be; DLookup("HolDate", "HOLIDAY", "HolDate =#" & Me.StartDate & "#") -- _________ Sean Bailey "Andrew Thorpe" wrote: > I have a table that includes a field StartDate. Another table (HOLIDAY) holds > dates announced as Holidays. I am trying to use the Lookup function to see if > my StartDate matches a HolidayDate. I have tried > If Forms!frmAssignment!StartDate = DLookup("HolDate", "HOLIDAY", "HolDate = > " & Me.StartDate) Then......... > Unfortunately, it doesn't run!! (The datatypes throughout are ShortDate). > I've tried the same using the # sign as part of the last section, but still > no joy. Would appreciate any help. Thank you. Andrew
|
Pages: 1 Prev: looking for a way around a write conflict... Next: Coding for shortcut keys |