Hi all, I have been implementing code to allow me to have multiple instances of a 'pop up alarm' form from Allen Browne.
I have added and altered all the code, I just need a little help with the last bit.
My startup form timer had code to open the alarm form at the correct alarm using the 'CommentNumber' field and a string as below. Then simple DoCmd.Open code....
The final part I need to do is change this line DoCmd.OpenForm "frmPopUpAlarm", acNormal, , "[CommentNumber] = " & varCommentNumber for a Call function - Call OpenAnAlarm()
However, I'm unsure how to call the alarm form at the correct 'CommentNumber'. Could somebody help me with this bit?
I have Call OpenAnAlarm("[CommentNumber] = " & varCommentNumber) but I know it isn't correct
Many thanks for any help!!!
I have added and altered all the code, I just need a little help with the last bit.
My startup form timer had code to open the alarm form at the correct alarm using the 'CommentNumber' field and a string as below. Then simple DoCmd.Open code....
Code:
Private Sub Form_Timer()
Dim strWhere As String
Dim varCommentNumber As Variant
strWhere = "Format([CommentAlarm], ""yyyymmddhhnn"") = '" & _
Format(Now(), "yyyymmddhhnn") & "' AND " & _
"[AlarmComputerName] = '" & Environ("Computername") & "'"
varCommentNumber = (DLookup("[CommentNumber]", "tblCustomerComments", strWhere))
If IsNull(varCommentNumber) Then
' There's no current comment for that machine
Else
DoCmd.OpenForm "frmPopUpAlarm", acNormal, , "[CommentNumber] = " & varCommentNumber
End If
End Sub
The final part I need to do is change this line DoCmd.OpenForm "frmPopUpAlarm", acNormal, , "[CommentNumber] = " & varCommentNumber for a Call function - Call OpenAnAlarm()
However, I'm unsure how to call the alarm form at the correct 'CommentNumber'. Could somebody help me with this bit?
I have Call OpenAnAlarm("[CommentNumber] = " & varCommentNumber) but I know it isn't correct
Many thanks for any help!!!