Is This OK?

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I have a DSum in a rowsource.
Is it OK or is there a better way?
Thanks
DS

With Forms!frmFXHousePayment!ListOpen
..RowSource = "SELECT tblHouseChecks.CheckID,
Format([ChkDate],""m/dd/yyyy"") AS DT, " & _
"[ChkTotal]-Nz(DSum(""PayAppliedAmount"",""tblHousePayApplied"",""PayAppliedCheckID=""
& [CheckID]),0) AS RM, " & _
"tblHouseChecks.ChkPaid, tblHouseChecks.ChkTotal " & _
"FROM tblHouseChecks " & _
"WHERE (((tblHouseChecks.ChkPaid) = 0)) " & _
"ORDER BY tblHouseChecks.CheckID, Format([ChkDate],""m/dd/yyyy"");"
..ColumnCount = 5
..ColumnWidths = "1.1 in;1.25 in;.75 in;0 in.0 in"
..Requery
End With
 
I have a DSum in a rowsource.
Is it OK or is there a better way?

A better way to do... what?

We have no way to know what you're trying to accomplish or what you want to
see.

John W. Vinson [MVP]
 
John said:
A better way to do... what?

We have no way to know what you're trying to accomplish or what you want to
see.

John W. Vinson [MVP]

I'm grabbing the total of payments from another table. I just never
used a DSum in a rowsource before and I wasn't sure if that it's okto do it.
Thanks
DS


With Forms!frmFXHousePayment!ListOpen
..RowSource = "SELECT tblHouseChecks.CheckID,
Format([ChkDate],""m/dd/yyyy"") AS DT, " & _
"[ChkTotal]-Nz(DSum(""PayAppliedAmount"",""tblHousePayApplied"",""PayAppliedCheckID=""
& [CheckID]),0) AS RM, " & _
"tblHouseChecks.ChkPaid, tblHouseChecks.ChkTotal " & _
"FROM tblHouseChecks " & _
"WHERE (((tblHouseChecks.ChkPaid) = 0)) " & _
"ORDER BY tblHouseChecks.CheckID, Format([ChkDate],""m/dd/yyyy"");"
..ColumnCount = 5
..ColumnWidths = "1.1 in;1.25 in;.75 in;0 in.0 in"
..Requery
End With
 
I'm grabbing the total of payments from another table. I just never
used a DSum in a rowsource before and I wasn't sure if that it's okto do it.
Thanks

You can *do* it... but I'm not sure why you'ld want to display a calculation
(particularly a slow and inefficient calculation) in every row of a combo box
- particularly when it's not the displayed field.

John W. Vinson [MVP]
 
Back
Top