hmstoo44dd
Programmer
I have a form with a continuous subform. When I open the form with the first code example the subform gets the error, 'you can't assign a value to this object' when trying to edit a field.
The other code example works fine.
Both open the form to the correct records.
The openform event =
strFilter = "SessionKey = " & OpenArgs
DoCmd.ApplyFilter , strFilter
The only thing unusual about the subform is that I'm using .absoluteposition to number the subform records.
Anyone have any ideas?
*********************************************************
Private Sub cmdDatePicker3_Exit(Cancel As Integer)
On Error GoTo ErrHandler
Dim stDocName As String
Dim intSession As Integer
intSession = Me![SessionKey]
DoCmd.Hourglass True
stDocName = "frmUpdatePaperTimes"
DoCmd.OpenForm stDocName, , , , , , intSession
DoCmd.Hourglass False
Me.Visible = False
Exit Sub
ErrHandler:
*******************************************************
Sub View_Form_Click()
On Error GoTo Err_View_Form_Click
Dim stDocName As String
Dim intSession As Integer
If Nz(Me!cboSession) = "" Then
Exit Sub
End If
intSession = Nz(Me!cboSession.Column(4))
stDocName = "frmUpdatePaperTimes"
DoCmd.OpenForm stDocName, , , , , , intSession
Me![cboSession] = ""
Me.Visible = False
Exit_View_Form_Click:
Exit Sub
Err_View_Form_Click:
The other code example works fine.
Both open the form to the correct records.
The openform event =
strFilter = "SessionKey = " & OpenArgs
DoCmd.ApplyFilter , strFilter
The only thing unusual about the subform is that I'm using .absoluteposition to number the subform records.
Anyone have any ideas?
*********************************************************
Private Sub cmdDatePicker3_Exit(Cancel As Integer)
On Error GoTo ErrHandler
Dim stDocName As String
Dim intSession As Integer
intSession = Me![SessionKey]
DoCmd.Hourglass True
stDocName = "frmUpdatePaperTimes"
DoCmd.OpenForm stDocName, , , , , , intSession
DoCmd.Hourglass False
Me.Visible = False
Exit Sub
ErrHandler:
*******************************************************
Sub View_Form_Click()
On Error GoTo Err_View_Form_Click
Dim stDocName As String
Dim intSession As Integer
If Nz(Me!cboSession) = "" Then
Exit Sub
End If
intSession = Nz(Me!cboSession.Column(4))
stDocName = "frmUpdatePaperTimes"
DoCmd.OpenForm stDocName, , , , , , intSession
Me![cboSession] = ""
Me.Visible = False
Exit_View_Form_Click:
Exit Sub
Err_View_Form_Click: