[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Run-Time Errror 424 - Object Required

Posted on 2008-10-03
8
Medium Priority
?
380 Views
Last Modified: 2013-11-28
I've read through plenty of postings on here regarding this message, but did not find one that suited my needs.  I have "frmProfile" that has a tabbed control on it, "ProfileTab".  On the first page, "Profile", Index(0), I have "cmbExemptStatus", a combo box that applies to an employee.  What I need is when the user changes the selection in that combo box, it filters a combo box, "cmbBenefitsStatus" on another page, "Benefits", Index (2).  

For example, if the user selects "Exempt" from the dropdown menu, it only displays options in cmbBenefitsStatus that apply to an exempt employee.  

I have posted what I have for it as of now.
Private Sub cmbExemptStatus_Change()
    
    If cmbExemptStatus = "Exempt" Then
       Me.ProfileTab.Pages(2).SetFocus
       cmbBenefitsStatus.RowSource "SELECT [benefits_dependant_status].[status_desc] FROM [benefits_dependant_status] WHERE [benefits_dependant_status].[status_desc] LIKE 'Salaried'"
   End If
    
End Sub

Open in new window

0
Comment
Question by:njmatt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22635164
might be better seeing what you have in that form.

can you attache your db here.. click Attach file below
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22644529
njmatt,

Can you tell us what happens when you run the code you have please.
Thanks.


If the two comboboxes are on the same tab this is easy.
If the two combos are on separate tabs it becomes hard.

Can both combos be on the same tab?

JeffCoachman

0
 
LVL 1

Author Comment

by:njmatt
ID: 22649699
Unfortunately, the combo boxes are on separate tabs and need to be so.  On the attached file, if you open 'frmProfile'.  You will see "Exempt Status" on the first Profile Tab.  By changing that combo box, it should update the "Benefits Plan" combo box on the "Benefits" tab.

If Exempt Status = Exempt, Benefits Plan should display only options for Salaried.
If Exempt Status = Non-Exempt, Non-Employee, Benefits Plan should display options for Hourly and Cobra.

Thanks for all your help.
IMED-TEST-2.zip
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22649877
try this


Private Sub cmbExemptStatus_Change()
Dim sql
If cmbExemptStatus = "Exempt" Then
    sql = "SELECT [benefits_dependant_status].[status_desc] FROM [benefits_dependant_status] WHERE [benefits_dependant_status].[status_desc] LIKE 'Salaried*'"
    Me.frmProfile_benefits_subform.SetFocus
    Me.frmProfile_benefits_subform.Form.cmbBenefitsStatus.RowSource = sql
End If
   
End Sub
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22649930
now, that will solve your problem of runtime error object required.

to make the selection options dynamic in combo cmbBenefitsStatus,

you need to make a relation between tables person_exempt_status and  benefits_dependant_status
0
 
LVL 1

Author Comment

by:njmatt
ID: 22650364
I got that to somewhat work for me.  A few things are happening that I don't understand.  

1.  When I make a selection in the Exempt Status combo box, the form jumps right to the Benefits Tab, which I don't want to happen.
2.  When I try to select an option in the Benefits Plan combo box, I get the following message:

"You tried to assign the Null value to a variable that is not a Variant data type."

3.  After I select, for example "Exempt" in the Exempt Status combo box, if I were to go back and change the selection, "Non-Exempt" disappears and the options are Exempt, Exempt, Non-Employee.  Also occurs if I select "Non-Employee", the combo box then reads Exempt, Non-Employee, Non-Employee.  And if you are to open up the person_exempt_status table, you'll see that the values will be replaced.

I've re-attached with the updated code.




IMED-TEST-21.zip
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 22650674
1.  When I make a selection in the Exempt Status combo box, the form jumps right to the Benefits Tab, which I don't want to happen.

Private Sub cmbExemptStatus_Change()
Dim sql
If cmbExemptStatus = "Exempt" Then
    sql = "SELECT [benefits_dependant_status].[status_desc] FROM [benefits_dependant_status] WHERE [benefits_dependant_status].[status_desc] LIKE 'Salaried*'"
    Me.frmProfile_benefits_subform.SetFocus
    Me.frmProfile_benefits_subform.Form.cmbBenefitsStatus.RowSource = sql
End If
Me.ProfileTab.Pages(0).SetFocus '<<< ADD this line
End Sub


as for the other issues

see line three of my previous comment ...

and better post a new question for that
0
 
LVL 1

Author Comment

by:njmatt
ID: 22651082
Thanks for you're help.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question