Share via

Filter problems in Access

Anonymous
2018-06-14T10:01:49+00:00

Hi I got a Problem in Access.

I have three tables:

RESIDENTES

PRODUCTOS_PRENDAS related to RESIDENTES via COD_RESIDENTE

OPERACIONES related to PRODUCTOS_PRENDAS via COD_PRODUCTO

I have created a three tab form.

First Tab-> RESIDENTES

Second Tab-> PRODUCTOS_PRENDAS subform of RESIDENTES

Third Tab-> OPERACIONES subform of PRODUCTOS_PRENDAS

I was told in an answer in this community that it should be better to have one main tab

form with two controls which opens the subforms PRDOCUCTOS_PRENDAS and OPERACIONES.

I have the code for this option. Everthing is clear. I got the answer in this community.

But the requirements of the client are that we must create a three tab form. It's a MUST.

Accordint to the answers and examples of this community I must set a filter.

There are two options:

  1. In the PRODUCTOS_PRENDAS Current event I wrote:

Forms("OPERACIONES_Subformulario").Filter = "COD_PRODUCTO =" & Nz(Me.COD_PRODUCTO, 0)

Forms("OPERACIONES_Subformulario").cboClient.DefaultValue = """" & Me.COD_PRODUCTO & """"

Error I got:

Error 2450 in execution time (real time):

Microsoft Access doesn't find the form "OPERACIONES_Subformulario" which the expression refers to.

  1. In the PRODUCTOS_PRENDAS Current event I wrote:

  Me.Form.OPERACIONES_Sub.Filter = "[COD_PRODUCTO]=" & Me.COD_PRODUCTO

  Me.Form.OPERACIONES_Sub.FilterOn = True

Error 2465 in execution time (real time).

Error defined by the application (program) or the object.

Any help?

Thanks.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. ScottGem 68,830 Reputation points Volunteer Moderator
    2018-06-14T11:40:47+00:00

    Can you explain why you must create a three tab form? What is the rationale behind it? It makes no sense to me.

    But to reference a subform, you need to use a specific reference set. Please check out this listing of how to reference a subform. http://access.mvps.org/Access/forms/frm0031.htm

    Basically you need to start with the mainform, reference the subform name then use the FORM reference before referencing the subform control.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2018-06-14T11:03:03+00:00

    Why are you using filters?

    If you set the properties of a sub-form ("Link Master Field" and "Link Child Fields") right, you do not need filters.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-06-14T10:36:06+00:00

    Ciao,

    try with:

      Me.PERACIONES_Sub.Form.Filter = "[COD_PRODUCTO]=" & Me.COD_PRODUCTO

      Me.OPERACIONES_Sub.Form.FilterOn = True

    Mimmo

    Was this answer helpful?

    0 comments No comments