M
Martin \(Martin Lee\)
In one of my FORMs, I wrote the following VBA ( I want to make this sub ai()
useable in all other forms ) :
Sub ai()
Dim sqsrps As String
If [income] * [period] <= [cost] Then
sqsrps = "INCOME TOO LOW"
End If
MsgBox sqsrps, , "Alert!"
End Sub
-------------------------------------
Then, I want to "reuse" this SUB in other FORMs.
So that I set a BUTTON on this other FORM, the VBA of this button is:
Private Sub Command692_Click()
ai()
End Sub
-------------------------------------------
However, it cannot work.
Why and How to solve this problem.
Thank you.
Martin Lee
useable in all other forms ) :
Sub ai()
Dim sqsrps As String
If [income] * [period] <= [cost] Then
sqsrps = "INCOME TOO LOW"
End If
MsgBox sqsrps, , "Alert!"
End Sub
-------------------------------------
Then, I want to "reuse" this SUB in other FORMs.
So that I set a BUTTON on this other FORM, the VBA of this button is:
Private Sub Command692_Click()
ai()
End Sub
-------------------------------------------
However, it cannot work.
Why and How to solve this problem.
Thank you.
Martin Lee