SteveL13
asked on
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?
ASKER
Didn't work... here is yuor code with real names plugged in...
Me.chkbxOPsked = (DCount("*", "tblOutpurchase", "[jobN]=" & Me.txtJobN) > 0)
Me.chkbxOPsked = (DCount("*", "tblOutpurchase", "[jobN]=" & Me.txtJobN) > 0)
did you check if the current value Me.txtJobN exists in table tblOutpurchase
ASKER
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.
where did you place the code?
post here along with the other codes
post here along with the other codes
ASKER
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.
??
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.
??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Thank you very much!
me.chkbox=(dcount("*","Oth