Hi Guys
for some silly reason i just cant see the wood for the trees with this problem, i have a form called "SignificantEventLogMachineEdit" that has this code on the forms "on Load" event
'this code counts the number of notes associated with the machine, if the number = 0 then all the report buttons are disabled
Dim LogCount As String
LogCount = DCount("CriticalChangeNotesID", "SignificantEventLogNotes", "CriticalChangeMachineID = " & Me.CriticalChangeMachineID)
If LogCount = 0 Then
Me.PDFButton.Enabled = False
Me.PreviewButton.Enabled = False
Me.PrintButton.Enabled = False
Me.EMailButton.Enabled = False
End If
this works really well, but the problem i cant get my head around is this
on this form i have a "add Event" button that opens a form called "SignificantEventLogAddEvent" this is a basic form that captures the machineID and notes and stores these in the table "SignificantEventLogNotes".
what i would like to happen is when this form is closed the code above on the "SignificantEventLogMachineEdit" form runs again so the buttons are now enabled.
i have tried putting the code into the forms "on Current" "On "activate" and "on open" events but the code does not run. if i shut and then open the form the code runs and the buttons are now enabled.
any help would be fantastic.
Steve