Sub Form Locks Up after one use

B

Bob Vance

Can someone tell me why after one filter my subform locks up and I can not
select another filter unless I close the foem and re-open it?
-------------------------------------------
Combo Box Update
-------------------------------------------------------
Private Sub cbOwnerIDB_AfterUpdate()

Dim nRtnValue As Integer
If IsNull(cbOwnerID1B.Column(0)) Then
nRtnValue = vbYes

End If
If nRtnValue = vbYes Then
cbOwnerID1B.value = cbOwnerIDB.value

Form("SubPayModePayChild").Form.Filter = "[OwnerID]=" & Me.cbOwnerIDB
Form("SubPayModePayChild").Form.FilterOn = True
If Len(Me.cbOwnerIDB.value & "") > 0 Then
Me.cbOwnerIDB.Locked = True
Dim rsFullAmtPaid As ADODB.Recordset
Set rsFullAmtPaid = New ADODB.Recordset



End If
End If
End Sub

Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3
 
J

John W. Vinson

Can someone tell me why after one filter my subform locks up and I can not
select another filter unless I close the foem and re-open it?
-------------------------------------------
Combo Box Update
-------------------------------------------------------
Private Sub cbOwnerIDB_AfterUpdate()

Dim nRtnValue As Integer
If IsNull(cbOwnerID1B.Column(0)) Then
nRtnValue = vbYes

End If
If nRtnValue = vbYes Then
cbOwnerID1B.value = cbOwnerIDB.value

Form("SubPayModePayChild").Form.Filter = "[OwnerID]=" & Me.cbOwnerIDB
Form("SubPayModePayChild").Form.FilterOn = True
If Len(Me.cbOwnerIDB.value & "") > 0 Then
Me.cbOwnerIDB.Locked = True
Dim rsFullAmtPaid As ADODB.Recordset
Set rsFullAmtPaid = New ADODB.Recordset



End If
End If
End Sub

Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3

Well I would expect the combo box cbOwnerIDB to be locked, since you're
specifically and explicitly locking it. Is that what you mean?

You're defining a recordset named rsFullAmtPaid and never using it, and
likewise using five statements to do the work of one:

Me!cbOwnerID1b = IIF(IsNull(Me!cbOwnerID1B.Column(0)), _
Me!cbOwnerIDB, Me!cbOwnerID1b)

I'm not sure what you expect this to accomplish!
 
B

Bob Vance

Thanks John, Worked Perfect :) Regards Bob

John W. Vinson said:
Can someone tell me why after one filter my subform locks up and I can not
select another filter unless I close the foem and re-open it?
-------------------------------------------
Combo Box Update
-------------------------------------------------------
Private Sub cbOwnerIDB_AfterUpdate()

Dim nRtnValue As Integer
If IsNull(cbOwnerID1B.Column(0)) Then
nRtnValue = vbYes

End If
If nRtnValue = vbYes Then
cbOwnerID1B.value = cbOwnerIDB.value

Form("SubPayModePayChild").Form.Filter = "[OwnerID]=" & Me.cbOwnerIDB
Form("SubPayModePayChild").Form.FilterOn = True
If Len(Me.cbOwnerIDB.value & "") > 0 Then
Me.cbOwnerIDB.Locked = True
Dim rsFullAmtPaid As ADODB.Recordset
Set rsFullAmtPaid = New ADODB.Recordset



End If
End If
End Sub

Thanks in advance for any help with this......Bob
MS Access 2007 accdb
Windows XP Home Edition Ver 5.1 Service Pack 3

Well I would expect the combo box cbOwnerIDB to be locked, since you're
specifically and explicitly locking it. Is that what you mean?

You're defining a recordset named rsFullAmtPaid and never using it, and
likewise using five statements to do the work of one:

Me!cbOwnerID1b = IIF(IsNull(Me!cbOwnerID1B.Column(0)), _
Me!cbOwnerIDB, Me!cbOwnerID1b)

I'm not sure what you expect this to accomplish!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top