S
Sue Wilkes
I have a main form (ALLFORM) the control source is the main table (GenReg).
I have a table Hyperlink which contains a hyperlink field. The tables are
linked using RegisterNumber (Primary Key). On my main form I have a SaveRec
button which does not enable until all the fields are completed. I would
like to include the hyperlink field in the validation so that the button on
the main form does not enable unless the fields on the main form AND the
hyperlink field on the subform have been completed. I am using a fucntion
and the afterupdate event on the fields as given below. Any help on this
would be greatfully appreciated, Regards Sue
Function CheckFieldIN() As Boolean
If Me.AddNewRecIN.Enabled = True And IsNull(Me.RegisterNumber) Or
IsNull(Me.DateReceived) Or IsNull(Me.ReceivedFrom) Or IsNull(Me.DeptCode) Or
IsNull(Me.Designation) Or IsNull(Me.Subject) Or IsNull(Me.CompanyName) Or
IsNull(Me.Hyperlink1) Then
CheckFieldIN = False
Else
CheckFieldIN = True
End If
End Function
//////////////////////////////////
Function CheckFieldOUT() As Boolean
If Me.AddNewRecOUT.Enabled = True And IsNull(Me.RegisterNumber) Or
IsNull(Me.DateSent) Or IsNull(Me.SentTo) Or IsNull(Me.DeptCode) Or
IsNull(Me.Designation) Or IsNull(Me.Subject) Or IsNull(Me.CompanyName) Or
IsNull(Me.Hyperlink1) Then
CheckFieldOUT = False
Else
CheckFieldOUT = True
End If
End Function
///////////////////////
Private Sub CompanyName_AfterUpdate()
If Me.AddNewRecIN.Enabled = True Then
Me.SaveAddNewRec1.Enabled = CheckFieldIN
Else
Me.SaveAddNewRec2.Enabled = CheckFieldOUT
End If
End Sub
I have a table Hyperlink which contains a hyperlink field. The tables are
linked using RegisterNumber (Primary Key). On my main form I have a SaveRec
button which does not enable until all the fields are completed. I would
like to include the hyperlink field in the validation so that the button on
the main form does not enable unless the fields on the main form AND the
hyperlink field on the subform have been completed. I am using a fucntion
and the afterupdate event on the fields as given below. Any help on this
would be greatfully appreciated, Regards Sue
Function CheckFieldIN() As Boolean
If Me.AddNewRecIN.Enabled = True And IsNull(Me.RegisterNumber) Or
IsNull(Me.DateReceived) Or IsNull(Me.ReceivedFrom) Or IsNull(Me.DeptCode) Or
IsNull(Me.Designation) Or IsNull(Me.Subject) Or IsNull(Me.CompanyName) Or
IsNull(Me.Hyperlink1) Then
CheckFieldIN = False
Else
CheckFieldIN = True
End If
End Function
//////////////////////////////////
Function CheckFieldOUT() As Boolean
If Me.AddNewRecOUT.Enabled = True And IsNull(Me.RegisterNumber) Or
IsNull(Me.DateSent) Or IsNull(Me.SentTo) Or IsNull(Me.DeptCode) Or
IsNull(Me.Designation) Or IsNull(Me.Subject) Or IsNull(Me.CompanyName) Or
IsNull(Me.Hyperlink1) Then
CheckFieldOUT = False
Else
CheckFieldOUT = True
End If
End Function
///////////////////////
Private Sub CompanyName_AfterUpdate()
If Me.AddNewRecIN.Enabled = True Then
Me.SaveAddNewRec1.Enabled = CheckFieldIN
Else
Me.SaveAddNewRec2.Enabled = CheckFieldOUT
End If
End Sub