Run-time '2450' error...

skilche1

Registered User.
Local time
Today, 03:44
Joined
Apr 29, 2003
Messages
226
I am working a database for tracking re-cuts of our material. I am trying to use combo box cascading to sort through two criterias, the first is to choose a Department via a combo box that would in turn refresh the next combo box for Material Series. Once the Material Series has been selected then I would be able to select the color of that style material. I am figuring on using the same code structure for the Material Series combo box to filter the material color, but first I need to be able to sort the material series for a particular department.

When I try to select from the Department combo box, I get this error code: "Run-time '2450' error: Fabrication Re-Cut Database can't find the form 'sfrmDataEntry3' referred to in a macro expression or visual basic"

Here is the code I using:

Code:
Private Sub cbo1_AfterUpdate()
    Dim sFabricEntry As String
    
    sFabricEntry = "SELECT [tblMaterialSeries].[materialserie_Id], [tblMaterialSeries].[department_Id], [tblMaterialSeries].[Series] " & _
                        "FROM tblMaterialSeries " & _
                        "WHERE [department_Id] = " & Me.cbo1.Value
    Forms!sfrmDataEntry3!CboMS.RowSource = sFabricEntry
    Forms!sfrmDataEntry3!CboMS.Requery
End Sub

Here is my Form layout:



Is there anyone that could help me through this?

Thank you in advance for your help.
 
You have to refer to the subform CONTAINER (the control on the main form that houses the subform), not the subform itself (unless the container and the subform have the same name). And, you need to use .FORM. to tell Access you want to refer to something on the subform, not the subform container.

So, like:

Forms!YourMainFormNameHere.sfrmDataEntry3.Form.CboMS.RowSource = sFabricEntry
Forms!YourMainFormNameHere.sfrmDataEntry3.Form.CboMS.Requery
 
First may I say, thanks for replying to my post, especially in a timely manor. I've seem a lot and come to admire your work. Thank you for of your contributions to this forum.

OK, I tried that and still get the same error.

Code:
    sFabricEntry = "SELECT [tblMaterialSeries].[materialserie_Id], [tblMaterialSeries].[department_Id], [tblMaterialSeries].[Series] " & _
                        "FROM tblMaterialSeries " & _
                        "WHERE [department_Id] = " & Me.cbo1.Value
    Forms!sfrmDataEntry1.sfrmDataEntry3.Form.CboMS.RowSource = sFabricEntry
    Forms!sfrmDataEntry1.sfrmDataEntry3.Form.CboMS.CboMS.Requery
 
You have to refer to the subform CONTAINER (the control on the main form that houses the subform), not the subform itself (unless the container and the subform have the same name). And, you need to use .FORM. to tell Access you want to refer to something on the subform, not the subform container.
I don't care how many times you say this Bob, it just doesn't register. I think the concept just doesn't make sense to the human brain. That's my guess...
 
I don't care how many times you say this Bob, it just doesn't register. I think the concept just doesn't make sense to the human brain. That's my guess...

ooookay, thanks for your random input. :confused:


Bob, actually the error code is the same, but it's now referring to sfrmDataEntry1, the form in which the Department combo box is located.

:cool:
 
Last edited:
OK, just for kicks, I closed down the db, opened it back up and tried to run it again in hopes of refreshing my system's memory. Now, the error I get is this: "Run-time Error'438': Object doesn't support this property or method"

Any ideas?

Thanks again,
 
OK, got it to work. Consider this to be resolved.

Thanks Bob.
 

Users who are viewing this thread

Back
Top Bottom