Is This OK?

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
 
J

John W. Vinson

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]
 
D

DS

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
 
J

John W. Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DSum Syntax 3
Publisher is filling blank lines with data 2
Change to report code needed 3
Syntax Error 4
Union Query Format 6
Combobox date value matching 0
ComboBox value matching 0
ORDER BY Problem 4

Top