i filter subform but Sum at footer doesn't change

kolorasta

Registered User.
Local time
Today, 05:07
Joined
Feb 19, 2007
Messages
18
Hi...
I have a form with a subform
in the form i have a combobox with a code on the "onchange" event to filter the subform
Code:
Private Sub ComboInstitucion_Change()
Documentos.Form.Filter = "id_institucion=" + ComboInstitucion.Value
Documentos.Form.FilterOn = True
End Sub

in the subform footer i have a textbox with this as controlsource
Code:
=Sum([importe])

everything is fine until i filter the subform... the textbox in the footer doesn't change. see pictures

unfilteredeg7.jpg


filteredtw9.jpg


It's an access project (ADP) with SQLServer2005

Any suggestions?
 
did you check out the requery command?

Dave
 
erroradminedujb8.png


it's seems there is an error in the SQL record source of the form
Code:
SELECT     documentos.numero, '[' + CAST(documentos.id AS varchar(10)) + '] ' + UPPER(documentos_tipos.abreviatura) 
                      + ' - ' + instituciones.abreviatura AS descripcion, documentos.importe, documentos.fecha_impresion, documentos.fecha_vencimiento, 
                      documentos.id_padre, documentos.id_institucion
FROM         documentos LEFT OUTER JOIN
                      instituciones ON documentos.id_institucion = instituciones.id LEFT OUTER JOIN
                      documentos_tipos ON documentos.id_tipo_documento = documentos_tipos.id

i tried using alias for tables as i read in some google search but didn't work

Code:
SELECT     d.numero, '[' + CAST(d.id AS varchar(10)) + '] ' + UPPER(dt.abreviatura) + ' - ' + i.abreviatura AS descripcion, d.importe, d.fecha_impresion, 
                      d.fecha_vencimiento, d.id_padre, d.id_institucion
FROM         documentos d LEFT OUTER JOIN
                      instituciones i ON d.id_institucion = i.id LEFT OUTER JOIN
                      documentos_tipos dt ON d.id_tipo_documento = dt.id

any suggestions?
 
1) Why do you have the square brackets within single quotes?
2) what do you use the plus sign?
3) are you trying to concatenate some fields or sum them?

Dave
 
i'm trying to concatenate fields... i put squera bracket because i want to show the square bracket in the concatenated field..look the screen capture how it is shown
 
Ok, if you want to concatenate values and show the square brackets as well I would do the following:

NewName:"["&[FieldName1]&" "&[FieldName2]&" "[OtherFieldNames]&"]"

The "" contain alpha characters
The & concatenates fields (do not use + in concatenations, Access can sometimes think you are adding fields)
The " " add spaces between fields

OK?

Dave
 
working with .adp (Access Project - SQL Server) "&" sing does not work,neither "" (double cuotes)... just '' (simple cuotes) and + (plus sign)

in access (.mdb files) you can use & and "", but not in SQL Server (.adp) queries.
 
wish you said so at the beginning, I never worked with adb projects

Dave
 
Thank you dave for your time... i said that it was an Access Project at the end of the first post ;)
 

Users who are viewing this thread

Back
Top Bottom