B
BRC
Hi all
I have a form that is used to edit "events" the form has a combo box
to select the date and the onupdate event shows all events for that
day in a subform. Clicking on the event opens the "eventfrm" to that
event where it can be edited.
I want to add a cmd button to the form so that the user can add a new
event to that day if it does not already exist. I put a button on the
form with the following code.
***************
Private Sub AddeventBtn_Click()
On Error GoTo Err_addeventbtn_Click
Dim dt As Date
dt = Me.SelDateCB
DoCmd.OpenForm "eventfrm", acNormal, , , acFormAdd, , dt
Exit_addeventbtn_Click:
Exit Sub
Err_addeventbtn_Click:
MsgBox Err.Description
Resume Exit_addeventbtn_Click
End Sub
**************************************
eventfrm has the following code in the onopen event;
*************************
Private Sub Form_Open(Cancel As Integer)
If not IsNull(Me.OpenArgs) Then
Me.dateTB = Me.OpenArgs
Else
End If
End Sub
**************************************************
I get an error that "you can't assign a value to this object"
error message and the Me.datetb= me.openargs is highlighted.
Any suggestions would be appreciated.
Thanks BRC
I have a form that is used to edit "events" the form has a combo box
to select the date and the onupdate event shows all events for that
day in a subform. Clicking on the event opens the "eventfrm" to that
event where it can be edited.
I want to add a cmd button to the form so that the user can add a new
event to that day if it does not already exist. I put a button on the
form with the following code.
***************
Private Sub AddeventBtn_Click()
On Error GoTo Err_addeventbtn_Click
Dim dt As Date
dt = Me.SelDateCB
DoCmd.OpenForm "eventfrm", acNormal, , , acFormAdd, , dt
Exit_addeventbtn_Click:
Exit Sub
Err_addeventbtn_Click:
MsgBox Err.Description
Resume Exit_addeventbtn_Click
End Sub
**************************************
eventfrm has the following code in the onopen event;
*************************
Private Sub Form_Open(Cancel As Integer)
If not IsNull(Me.OpenArgs) Then
Me.dateTB = Me.OpenArgs
Else
End If
End Sub
**************************************************
I get an error that "you can't assign a value to this object"
error message and the Me.datetb= me.openargs is highlighted.
Any suggestions would be appreciated.
Thanks BRC