"if not null" not working?

moorsey

Registered User.
Local time
Today, 01:31
Joined
Dec 28, 2005
Messages
49
I've been putting a few if not nulls into my current project, but I seem to be slipping up somewhere

firstly I have a continuous form, only one text box and a delete button on each, so new records can easily be added and deleted, im trying to put some error handeling so that if the delete button is pressed on the empty text box on the bottom blank form it doesnt die on me:

Private Sub cmdDelete_Click()

If Me.Type Is Not Null Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
Else
End If

End Sub

but i get "object required" on this??

secondly, I have a pop-up calendar window, I am trying to set it, so that it there is already a date entered, the calender object gets that date, otherwise it gets todays date, the latter does not work:

calendarselect = Me.dob.Name
DoCmd.OpenForm "dlgCalendar", , , , , acHidden
If Forms!frmMember!dob = Null Then
Forms!dlgcalendar!Calendar.Value = Date
Else: Forms!dlgcalendar!Calendar.Value = Forms!frmMember!dob
End If
Forms!dlgcalendar.Visible = True

calendarselect being a global variable holding the value of the text box the calendar date needs to go to, i.e dob, leaving date, e.t.c.

any advice appreciated
 
If Not IsNull(Me.Type) Then
If IsNull(Forms!frmMember!dob) Then

For the record, *nothing* is ever equal to a Null, including another Null!
Null is the absence of anything.
 
thanks man, thats a big help to lots of other things to, cheers!!
 

Users who are viewing this thread

Back
Top Bottom