Check a checkbox on main form if record exists in second form

I have a form bound to a table that has a checkbox.  I want this checkbox to be true if any record exists in an unrelated table.  Both tables are "related" via a commonly named field named "JobN".  This field is a number field.  How can I do this?
SteveL13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try this in the current event of the form

me.chkbox=(dcount("*","OtherTableName","[jobN]=" & me.JobN)>0)
0
SteveL13Author Commented:
Didn't work... here is yuor code with real names plugged in...

Me.chkbxOPsked = (DCount("*", "tblOutpurchase", "[jobN]=" & Me.txtJobN) > 0)
0
Rey Obrero (Capricorn1)Commented:
did you check if the current value Me.txtJobN exists in table tblOutpurchase
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

SteveL13Author Commented:
There is a record in tblOutpurchase that has a JobN value of 67 which is the key number of the JobN field in the main form.
0
Rey Obrero (Capricorn1)Commented:
where did you place the code?

post here along with the other codes
0
SteveL13Author Commented:
Hey, I just put the code in the onload event of the main form and IT WORKED!  Now, one more question...

On the same main form I have a 2nd checkbox.  I want that checkbox to be checked if "chkbxOPdone" is true in the same 2nd table.

??
0
Rey Obrero (Capricorn1)Commented:
me.chk2=dlookup("chkbxOpDone","tblOutpurchase", "[jobN]=" & Me.txtJobN)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SteveL13Author Commented:
Perfect!  Thank you very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.