zelarra821
Registered User.
- Local time
- Today, 13:32
- Joined
- Jan 14, 2019
- Messages
- 835
Hello, I am trying to pass this code to a module:
This code belongs to the function that MajP created.
The function that I have in the module, and in which it should go, is the following:
I call it from the form like this:
However, it tells me that an object is needed, and points out the following line of the module's function:
I have tried to pass different parameters, but all give me some kind of error.
Let's see if you could tell me what's wrong. Thank you!
Code:
cmbGenero.InitalizeFilterCombo Me.Genero1, "Genero", FromBeginning, True, True
This code belongs to the function that MajP created.
The function that I have in the module, and in which it should go, is the following:
Code:
Public Sub DespuesDeActualizarFormato(FName As Form, NumFormato As Long, cmbFormato As String)
FName.Genero1.RowSource = "SELECT [TGeneros].[Genero], [TLibros].[Estado], [TFormatos].[Formato] " _
& "FROM TFormatos INNER JOIN ((TGeneros INNER JOIN TSubgeneros ON [TGeneros].[ID] = [TSubgeneros].[Genero]) INNER JOIN TLibros ON [TSubgeneros].[ID] = [TLibros].[Subgenero]) ON [TFormatos].[ID] = [TLibros].[Formato] " _
& "GROUP BY [TGeneros].[Genero], [TLibros].[Estado], [TFormatos].[Formato] " _
& "HAVING ((([TLibros].[Estado]) = " & NumFormato & ") And (([TFormatos].[Formato]) = " & cmbFormato & "))" _
& "ORDER BY [TGeneros].[Genero]"
FName.Genero1 = ""
cmbGenero.InitalizeFilterCombo FName.Genero1, "Genero", FromBeginning, True, True
FName.Requery
End Sub
I call it from the form like this:
Code:
Call DespuesDeActualizarFormato(Me, 4, "[Forms]![FPendientes]![Formato1]")
However, it tells me that an object is needed, and points out the following line of the module's function:
Code:
cmbGenero.InitalizeFilterCombo FName.Genero1, "Genero", FromBeginning, True, True
End Sub
I have tried to pass different parameters, but all give me some kind of error.
Let's see if you could tell me what's wrong. Thank you!