Microsoft
Software
Hardware
Network
Question : Checking for duplicate record AfterLostFocus
I have a Jobs table (tblJobs) that has 3 fields I need to manipulate. On data entry of a new job (I have a command button to "Add" a new job) I need the following to happen as the user enters the data:
1. Enter Job Number (JobNumber)...Sample: 0035 (text)
2. Enter the Year (JobYear)...Sample: 2010 (text)
3. When losing focus on the Year, I want to combine the two fields into one (JobNumberExt)...Sample 00352010 (text)
4. I want the code to check tblJobs to see if that JobNumber already exists.
5. If so, display a warning msg and set focus to the JobNumber field for modification..
6. If not, set focus to next field (JobName)
Reasoning to help clarify situation...every year the JobNumber starts at 0001. Therefore I have to enter the JobYear and combine the two fields to eliminate duplicate jobs.
Answer : Checking for duplicate record AfterLostFocus
private sub jobYear_lostfocus()
if dcount("*","tbljobs","jobn
umber='" & me.jobNumber &"' and jobyear='" & me.jobYear & "'")>0 then
msgbox "record already exists"
me.jobnumber.setfocus
end if
end sub
Random Solutions
I have created a global distribution group - it opos up twice in the GAL - one is the group that shows the contacts - but it shows another exact name of the group (there is only one ion AD) with NO us
MS Access - First and Last Name field into Full Name
trying to read (compressed) laptop disk...
Automatically run an application as another user
ms office oem vs licensing
IE7 freezes on certain websites (w and w/out addons)
Exporting Access Query To Excel: Format Currency to Number
Problem with DoCmd.RunSQL "INSERT INTO " and memo fields
Installing Exchange 2010, having issues passing the Readiness Check.
Having a weird Format Conditions problem...