List doesn't receive data on form load ...

Steff_DK

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 12, 2005
Messages
110
When I view customer details in the attached db, the list (liste26 on frmDetails - lower left on the form) doesn't get data.

The SQL syntax should be correct since I got it from a qry made with the wizard.

Whats wrong???? I'm sure there's a simple explanation ... :rolleyes:
 

Attachments

Steff_DK said:
When I view customer details in the attached db, the list (liste26 on frmDetails - lower left on the form) doesn't get data.

The SQL syntax should be correct since I got it from a qry made with the wizard.

Whats wrong???? I'm sure there's a simple explanation ... :rolleyes:
-------------------------------------------------------------------------

Can i ask want data Liste26 is suppose too show please, as i can not understand the language
 
This is in the form load event for frmDetails. Liste26 should show the total of buys for the customer ...

Code:
Private Sub Form_Load()


Dim SQL As String
SQL = "SELECT DISTINCTROW Sum(buys.pris) AS [Sum Of pris] FROM buys GROUP BY buys.kunde_id HAVING (((buys.kunde_id)='"
SQL = SQL & Me.OpenArgs & "'));"
Me!Liste26.ControlSource = SQL
Me!Liste26.Requery
Me.Requery

Form_frmdetails.SetFocus
DoCmd.MoveSize 1000, 1000, 13000, 8000
Kommandoknap17.SetFocus

End Sub
 
Hi,

Set the controls rowsource type to table/query.

Then change the code to;

Code:
SQL = "SELECT DISTINCTROW Sum(buys.pris) AS [Sum Of pris] FROM buys WHERE (((buys.kunde_id)='" & Me.OpenArgs & "'))"
Me!Liste26.RowSource = SQL

HTH

TS
 

Users who are viewing this thread

Back
Top Bottom