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
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