Simle textBox reporting info

  • Thread starter Thread starter Lorenzo
  • Start date Start date
L

Lorenzo

Hello I am struggling with a simple task that is complicating my morning. I
have a simple start up form where I want to add few textBoxes that sip data
from my tables to get some totals. I have the following unbound text box
that I would like to fill for example with the total of the invoices:

I am pointing the source of this control from the property settings to, for
example: DSum("[tblFatture]![dblImporto]", "tblFatture", <<additional
criterias here>>)

This isn't working and I ahve also tried via VBA like this:
Private Sub Form_Load()
Me.txtTotaleFatturato.Text = DSum("[tblFatture]![dblImporto]", "tblFatture")
End Sub

Not working, what am I doing wrong?
Lorenzo
 
"Lorenzo"
Hello I am struggling with a simple task that is complicating my morning. I
have a simple start up form where I want to add few textBoxes that sip data
from my tables to get some totals. I have the following unbound text box that
I would like to fill for example with the total of the invoices:

I am pointing the source of this control from the property settings to, for
example: DSum("[tblFatture]![dblImporto]", "tblFatture", <<additional
criterias here>>)

This isn't working and I ahve also tried via VBA like this:
Private Sub Form_Load()
Me.txtTotaleFatturato.Text = DSum("[tblFatture]![dblImporto]", "tblFatture")
End Sub

Not working, what am I doing wrong?
Lorenzo

Not sure if it would cause the expression to NOT work, but the first argument
should be the name of the field only. Get rid of the TableName!FieldName
syntax. The Second argument takes care of the table.

Also, this is often caused by an incorrect criteria argument. Does it work with
no criteria? If so then try it with a very simple criteria. If both of those
work and your required criteria does not then that criteria is likely being
expressed wrong.
 
Back
Top