hi everyone could you help me understand public functions or global things with the following example please.
I have the folowing piece of code which helps me to "check digit" an eight figure number.It is on a bound text box in a form and only refers to that text box.IE using "Me"
What I would like to do is make this code available to other text boxes in other forms.I think that you call this a global module (I'm a learner here).
Private Sub HAWBNO_Enter()
If IsNumeric(Me!AWP) Then
If Val(Left(Me!AWBNO, 7)) Mod 7 = Val(Right(Me!AWBNO, 1)) Then
Me!AWBNO.ForeColor = 16711680
Else 'error in check digit
MsgBox "ERROR ! AWB CHECK DIGIT", 48, "ERROR"
End If
End If
End Sub
Please try to keep it in simple language as I am trying to learn from scratch here.
Many thanks for your patience.
best rgds
Nick
I have the folowing piece of code which helps me to "check digit" an eight figure number.It is on a bound text box in a form and only refers to that text box.IE using "Me"
What I would like to do is make this code available to other text boxes in other forms.I think that you call this a global module (I'm a learner here).
Private Sub HAWBNO_Enter()
If IsNumeric(Me!AWP) Then
If Val(Left(Me!AWBNO, 7)) Mod 7 = Val(Right(Me!AWBNO, 1)) Then
Me!AWBNO.ForeColor = 16711680
Else 'error in check digit
MsgBox "ERROR ! AWB CHECK DIGIT", 48, "ERROR"
End If
End If
End Sub
Please try to keep it in simple language as I am trying to learn from scratch here.
Many thanks for your patience.
best rgds
Nick