I am newby with applying the validation rule expression. I need help with the expression for the validation rule at the table or form level. There is a field that cannot be blank when the record is saved. Using the “required” property interferes with other processes that need to run to complete the transaction
Steps are:
- Select a date from a combo box list
- Record is appended to the Appointment table
- GroupID attribute that cannot be blank. A value is copied from another list (on a subform) and pasted this value in the GroupID attribute (see ** code below).
- The Save Appointment button (* see code below) updates the record in the Appointment
These expressions failed:
*Button code:
Code:
Private Sub sv_Click()
On Error GoTo Err_sv_Click
DoCmd.Close
DoCmd.Close acForm, "AdvisorAppointments-new Scheduler1:1"
DoCmd.SetWarnings False
DoCmd.OpenQuery "Updates Appointment table with Major from Students table" 'updates major in appointment table
DoCmd.OpenQuery "Update GroupAdvisingSessionID in Students table" 'updates student table DoCmd.SetWarnings True
Exit_sv_Click:
**Copy and pasting code
Code:
Private Sub GroupAdvisingRecordID_DblClick(Cancel As Integer)
'updates GroupRecID in the appointment table from the scheduler form when GroupAdvisingRecordID field is double clicked
DoCmd.SetWarnings False
DoCmd.OpenQuery "Update GroupRecID in Appointment table from Scheduler1:1"
'updates GroupAdvisingSessionID in Students table
DoCmd.OpenQuery "Update GroupAdvisingSessionID in Students table"
DoCmd.SetWarnings True
'DoCmd.RefreshRecord
End Sub
I appreciate any help ....