Help with runtime error #459 (1 Viewer)

robertbwainwright

Registered User.
Local time
Today, 09:57
Joined
May 2, 2012
Messages
62
I'm getting a run time error (#459) when trying to run some code. This just started happening and the code ran fine 1/2 an hour ago. The code is filtering subform on load. Not sure what the heck has happened. Here is the code:

Code:
Private Sub Form_Load()
    '********************************************
    'Filter for the user
    '********************************************
 
    [frmCommoditySupplierSpend-SubForm1-ByVend].Form.Filter = "[Commodity Mgr]= '" & strComodityMgr & "'"
    [frmCommoditySupplierSpend-SubForm1-ByVend].Form.FilterOn = True
    '********************************************
 
End Sub

if I stop the code I have a similiar code running in a combo box and I'm getting the same error. PLEASE HELP! Not sure why this has all of a sudden happened.
 

bob fitz

AWF VIP
Local time
Today, 15:57
Joined
May 23, 2011
Messages
4,719
If you're setting the filter for the form that is loading, you could try:
Code:
Private Sub Form_Load()
    '********************************************
    'Filter for the user
    '********************************************
 
    Me.Filter = "[Commodity Mgr]= '" & strComodityMgr & "'"
    Me.FilterOn = True
    '********************************************
 
End Sub
 

robertbwainwright

Registered User.
Local time
Today, 09:57
Joined
May 2, 2012
Messages
62
I created a new db and pasted all the objects from the old into the new. Problem solved. Not sure what happened.
 

Users who are viewing this thread

Top Bottom