I
Imran J Khan
Using information from similar questions in this forum, I am trying to create
a stand alone module in a library db that can be called from a large number
of forms in a second db (they reside on the same disk and several similar
subs have been in use).
The forms are essentially identical, and need to disable a date field unless
the ntUser is same as the 'taskedby' and that is the same as 'taskedto'.
I prefer to have a single stand alone module to make house keeping simple.
The following is my stand alone module:
Option Compare Database
Option Explicit
Public Sub setTogglePlannedDateControl(WhatForm As Form)
If (Nz(WhatForm.taskedBy, "") <> "") Then
If (WhatForm.taskedBy = getCurrentUser) And (WhatForm.taskedBy <>
WhatForm.taskedTo) Then
WhatForm.dueDate.Locked = True
End If
End If
End Sub
And the following is the event procedure call I am trying to use:
setTogglePlannedDateControl Me
error msg:Compile error Sub or Function Not Defined
I have also tried the following:
setTogglePlannedDateControl (Me)
setTogglePlannedDateControl (Me.Form.Name)
setTogglePlannedDateControl (Form1)
Imran.
a stand alone module in a library db that can be called from a large number
of forms in a second db (they reside on the same disk and several similar
subs have been in use).
The forms are essentially identical, and need to disable a date field unless
the ntUser is same as the 'taskedby' and that is the same as 'taskedto'.
I prefer to have a single stand alone module to make house keeping simple.
The following is my stand alone module:
Option Compare Database
Option Explicit
Public Sub setTogglePlannedDateControl(WhatForm As Form)
If (Nz(WhatForm.taskedBy, "") <> "") Then
If (WhatForm.taskedBy = getCurrentUser) And (WhatForm.taskedBy <>
WhatForm.taskedTo) Then
WhatForm.dueDate.Locked = True
End If
End If
End Sub
And the following is the event procedure call I am trying to use:
setTogglePlannedDateControl Me
error msg:Compile error Sub or Function Not Defined
I have also tried the following:
setTogglePlannedDateControl (Me)
setTogglePlannedDateControl (Me.Form.Name)
setTogglePlannedDateControl (Form1)
Imran.