Help with code please

  • Thread starter Thread starter julief
  • Start date Start date
J

julief

I have a data sheet form in which I want to enforce entry in Date Issued
before Date Returned is completed. Both are set to short date field
properties in the table.

I have included the following code in the after update property on Date
Issued but I keep getting debug - would be very grateful is someone could
point out where I am going wrong. I have tried to move IsNull to before
Me.Date Issued but this still wont work.

Private Sub Date_Issued_AfterUpdate()
If Me.Date_Issued IsNull Then
Me.Date_Returned.Enabled = False
Else
Me.Date_Returned.Enabled = True
End If
End Sub
 
julief said:
I have a data sheet form in which I want to enforce entry in Date Issued
before Date Returned is completed. Both are set to short date field
properties in the table.

I have included the following code in the after update property on Date
Issued but I keep getting debug - would be very grateful is someone could
point out where I am going wrong. I have tried to move IsNull to before
Me.Date Issued but this still wont work.

Private Sub Date_Issued_AfterUpdate()
If Me.Date_Issued IsNull Then
Me.Date_Returned.Enabled = False
Else
Me.Date_Returned.Enabled = True
End If
End Sub


This line ...

If Me.Date_Issued IsNull Then

.... should read ...

If IsNull(Me.Date_Issued) Then
 
This works a treat if I have had any data in date issued field but if there
has never been any data in date issued then date returned is enabled. Is
there something else I should be doing.
 
julief said:
This works a treat if I have had any data in date issued field but if
there
has never been any data in date issued then date returned is enabled. Is
there something else I should be doing.

Try calling the After Update event from the Current event.

Keith.
www.keithwilby.co.uk
 
Back
Top