T
TraciAnn via AccessMonster.com
I've seen a few threads on this but they each seem to be unique to their
situation.
Ac'07 in '03 format. frmMain two subForms directly on frmMain and 5 subForms
on tabs.
UserName is the PK of the primary table that is part of the query control
source. I moved the txtUserName control from a sub to the main form. That's
when the error message began, but it doesn't appear to be related to the
issue because the control isn't mentioned in any of the form events.
I tried moving the control back to it's original position and had no change
in the error. I have also tried Compact/Repair, with no improvement.
Two important notes:
1. The error NEVER appeared prior to moving the txtUserName Control
2. The BE was moved from Ac to SQL last week
The error appears twice, each with a separate event - OnOpen and OnCurrent.
I've included the code below for the forms with corresponding Events to the
errors. All of which are very simple so I'm perplexed by the errors.
(All code has the same error handling as in the first, I removed the error
handling code to be friendly on they eye
frmMain========
Private Sub Form_Current()
On Error GoTo Err_Form_Current
Me.cboFindContact.Value = Me.UserName
If Me.FilterOn Then
Me.cboFindContact.Enabled = False
Else
Me.cboFindContact.Enabled = True
End If
With Me.fsubComment.Form
.AllowAdditions = False
End With
Me.cmdGoToFirst.Visible = True = (Me.CurrentRecord > 1)
Me.cmdPreviousUser.Visible = True = (Me.CurrentRecord > 1)
Me.RecordsetClone.MoveLast 'could be any ie: Movefirst
Me.cmdNextUser.Visible = True = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
Me.cmdGoToLast.Visible = True = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
Exit_Form_Current:
Exit Sub
Err_Form_Current:
MsgBox Err.Description
Resume Exit_Form_Current
End Sub
SUB1 (on frmMain)==========
Private Sub Form_Current()
If Not Me.NewRecord Then
Me.AllowAdditions = False
End If
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Me.AllowAdditions = False
End If
SUB2 (on Tab)==========
Private Sub Form_Current()
If Not Me.NewRecord Then
Me.AllowAdditions = False
End If
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Me.AllowAdditions = False
End If
Thanks!
situation.
Ac'07 in '03 format. frmMain two subForms directly on frmMain and 5 subForms
on tabs.
UserName is the PK of the primary table that is part of the query control
source. I moved the txtUserName control from a sub to the main form. That's
when the error message began, but it doesn't appear to be related to the
issue because the control isn't mentioned in any of the form events.
I tried moving the control back to it's original position and had no change
in the error. I have also tried Compact/Repair, with no improvement.
Two important notes:
1. The error NEVER appeared prior to moving the txtUserName Control
2. The BE was moved from Ac to SQL last week
The error appears twice, each with a separate event - OnOpen and OnCurrent.
I've included the code below for the forms with corresponding Events to the
errors. All of which are very simple so I'm perplexed by the errors.
(All code has the same error handling as in the first, I removed the error
handling code to be friendly on they eye
frmMain========
Private Sub Form_Current()
On Error GoTo Err_Form_Current
Me.cboFindContact.Value = Me.UserName
If Me.FilterOn Then
Me.cboFindContact.Enabled = False
Else
Me.cboFindContact.Enabled = True
End If
With Me.fsubComment.Form
.AllowAdditions = False
End With
Me.cmdGoToFirst.Visible = True = (Me.CurrentRecord > 1)
Me.cmdPreviousUser.Visible = True = (Me.CurrentRecord > 1)
Me.RecordsetClone.MoveLast 'could be any ie: Movefirst
Me.cmdNextUser.Visible = True = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
Me.cmdGoToLast.Visible = True = (Me.CurrentRecord < _
Me.RecordsetClone.RecordCount)
Exit_Form_Current:
Exit Sub
Err_Form_Current:
MsgBox Err.Description
Resume Exit_Form_Current
End Sub
SUB1 (on frmMain)==========
Private Sub Form_Current()
If Not Me.NewRecord Then
Me.AllowAdditions = False
End If
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Me.AllowAdditions = False
End If
SUB2 (on Tab)==========
Private Sub Form_Current()
If Not Me.NewRecord Then
Me.AllowAdditions = False
End If
Private Sub Form_Open(Cancel As Integer)
If Me.RecordsetClone.RecordCount = 0 Then
Me.AllowAdditions = False
End If
Thanks!