Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Only one uniq record with specific Employee- and date-values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BrunoKP - 10 Jan 2008 23:37 GMT
I have a table with an EmployeeID-field and a date-field. Before I add a new
record I want to check that there is no record with that specific EmployeeID
number and specific date already, because I want only one record with that
specific combination of the EmployeeID number the date.
Which function do you suggest?
I tried with FindFirst, but with that I can only test for one field.
Yes I am not much experienced with Access/VBA.
KARL DEWEY - 11 Jan 2008 00:25 GMT
Why not go into table design an create a two-field index and set to unique?
Signature

KARL DEWEY
Build a little - Test a little

> I have a table with an EmployeeID-field and a date-field. Before I add a new
> record I want to check that there is no record with that specific EmployeeID
[quoted text clipped - 3 lines]
> I tried with FindFirst, but with that I can only test for one field.
> Yes I am not much experienced with Access/VBA.
BrunoKP - 11 Jan 2008 12:08 GMT
Good idea, which I have followed. But still I have to check for unique-ness
before I add a new record. I found another answer by Douglas J. Steele:
(...And ContactDate = " & Format(SalesForce.Fields("Date"),
"\#yyyy\-mm\-dd\#") & " And ContactType= '" & SalesForce.Fields("Type") & "'")
about how to check for multible criterias in FindFirst, included a date. In
that way the whole problem has been solved.

"KARL DEWEY" skrev:

> Why not go into table design an create a two-field index and set to unique?
>
[quoted text clipped - 5 lines]
> > I tried with FindFirst, but with that I can only test for one field.
> > Yes I am not much experienced with Access/VBA.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.