April- This link details how to loop thru the controls on a form. From there it is pretty easy to check if any of the checkboxes are or are not checked. http://www.uvm.edu/~acolli/VBA/code.php?id=53 Once you figure out if your criteria has been met, you can show a message box and exit the sub, without closing the form. ' Go to the table tblLocationArea access a NewRecord get the ' Employee's ID number from this form in field nbrEmpID and populate the same field on the form then ' populate the txtEmpArea field with "1" '(the nbrAreaID is an autonumber) Not exactly sure what your asking here. Do you want to insert a new record into tblLocationArea? in code? -Anthony -----Original Message----- From: April Pace [mailto:4office@xxxxxxxxxxxxx] Sent: Wednesday, January 08, 2003 1:54 PM To: Office (E-mail) Subject: [mso] Access Code Needed Can somebody help me write this: (it will be placed on the frmEmployeeInfo) Private Sub CbxArea1_Click() If Me!cbxArea1.Value = -1 Then ' Go to the table tblLocationArea access a NewRecord get the ' Employee's ID number from this form in field nbrEmpID and populate the same field on the form then ' populate the txtEmpArea field with "1" '(the nbrAreaID is an autonumber) Else ' Do Nothing End If End Sub Also when I close the frmEmployeeInfo form I would need to add a validation rule that at least one of those checkboxes (there are 4 like the one above - cbxArea2 etc.) had been check .... if not then it would not close and a message would appear: "Please check which areas the Employee will work in" and set the focus back on CbxArea1... Here is the code already on the CommandClose: Private Sub CommandClose_Click() On Error GoTo Err_CommandClose_Click DoCmd.Close Exit_CommandClose_Click: Exit Sub Err_CommandClose_Click: MsgBox Err.Description Resume Exit_CommandClose_Click End Sub Thanks for ALL YOUR HELP! ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx?Subject=unsubscribe Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles ************************************************************* ************************************************************* You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or MicrosoftOffice@xxxxxxxxxxxxxxxx To send mail to the group, simply address it to mso@xxxxxxxxxxxxx To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx?Subject=unsubscribe Or, visit the group's homepage and use the dropdown menu. This will also allow you to change your email settings to digest or vacation (no mail). //www.freelists.org/webpage/mso To be able to use the files section for sharing files with the group, send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with instructions. Once you are a member of the files group, you can go here to upload/download files: http://www.smartgroups.com/vault/msofiles *************************************************************