User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS Access and FileMaker Pro section within the Web Development category of DaniWeb, a massive community of 375,169 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,256 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS Access and FileMaker Pro advertiser:
Views: 1871 | Replies: 0
Reply
Join Date: Jun 2006
Posts: 67
Reputation: agrothe is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 9
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster in Training

Stumped: Error on Combo Box Sort

  #1  
Apr 5th, 2007
I'm trying to filter a subform based on combobox selection and getting a runtime error '424' - object required.

I downloaded the code from http://www.techonthenet.com/access/f...ilter_form.php and verified that it works in the provided sample database.

I copied the example and I'm getting the runtime error. I tried copying everything to a new form in case of form corruption with no results.

I've checked all the names of forms and controls as well.

Option Compare Database
Const LSQL = "SELECT [Order].[Id], [Order].[SellingPrice], [Client].[CompanyName], [Job].[TakenBy], [Job].[Referral], [Order].[CompletionDate], [Order].[Total_Labour], [Order].[Total_Material] FROM (([Client] INNER JOIN [Order] ON [Client].[CustomerID] =[Order].[CustId]) INNER JOIN [Job] ON [Order].[Id] =[Job].[Order_Id])"
Dim SQL As String

Sub SetFilter()

    SQL = LSQL & " where CustomerID = '" & cboEmp.Value & "'"
    
    form_frmReportSub.RecordSource = SQL 'ERROR IS HERE

End Sub

Private Sub cboEmp_AfterUpdate()
    
    'Call subroutine to set filter based on selected CustomerID
    SetFilter
    
End Sub

The code breaks at form_frmReportSub.RecordSource = SQL as noted above.
------------------------------------------------------------
ConnectNL Directory | NLTourist | Free eLearing Courses
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS Access and FileMaker Pro Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS Access and FileMaker Pro Forum

All times are GMT -4. The time now is 11:44 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC