A
Asif Rehman
Hello Again
Yesterday I asked if it was possible to lock certain
records in a form but not all of them.
For example I have created a invoicing database and what I
would like to do is when a invoice is created after the
day it is created those records to be locked (kind of a
over night process) and any other previous, but to be able
to create new records when required.
I got help from Andy Cole (Thank You again) I have created
a module with the following code and named it LockCtls:
Option Compare Database
Private Sub LockCtls(blnLock As Boolean)
Me.CustomerID.Locked = blnLock
Me.EmployeeID.Locked = blnLock
Me.InvoiceNumber.Locked = blnLock
Me.OrderDate.Locked = blnLock
Me.RequiredDate.Locked = blnLock
Me.VanID.Locked = blnLock
Me.Subtotal.Locked = blnLock
Me.Vat.Locked = blnLock
Me.Total.Locked = blnLock
End Sub
And I have inserted the following code into my Order
Form's OnCurrent event:
Private Sub Form_Current()
Dim blnLockIt As Boolean
If Date > DateValue(Nz(Me.OrderDate, Date)) Then
blnLockIt = True
Else
blnLockIt = False
End If
LockCtls blnLockIt
End Sub
Now when I go into my orders form I get the following
error and the LockCtls is highlighted,
Expected Variable or Procedure, Not Module.
I have no idea what is wrong, any help will again be much
appreciated.
Kindest Regards
Asif
Yesterday I asked if it was possible to lock certain
records in a form but not all of them.
For example I have created a invoicing database and what I
would like to do is when a invoice is created after the
day it is created those records to be locked (kind of a
over night process) and any other previous, but to be able
to create new records when required.
I got help from Andy Cole (Thank You again) I have created
a module with the following code and named it LockCtls:
Option Compare Database
Private Sub LockCtls(blnLock As Boolean)
Me.CustomerID.Locked = blnLock
Me.EmployeeID.Locked = blnLock
Me.InvoiceNumber.Locked = blnLock
Me.OrderDate.Locked = blnLock
Me.RequiredDate.Locked = blnLock
Me.VanID.Locked = blnLock
Me.Subtotal.Locked = blnLock
Me.Vat.Locked = blnLock
Me.Total.Locked = blnLock
End Sub
And I have inserted the following code into my Order
Form's OnCurrent event:
Private Sub Form_Current()
Dim blnLockIt As Boolean
If Date > DateValue(Nz(Me.OrderDate, Date)) Then
blnLockIt = True
Else
blnLockIt = False
End If
LockCtls blnLockIt
End Sub
Now when I go into my orders form I get the following
error and the LockCtls is highlighted,
Expected Variable or Procedure, Not Module.
I have no idea what is wrong, any help will again be much
appreciated.
Kindest Regards
Asif