G
George Papadopoulos
I have written the code below :
Private Sub Form_Load()
Dim strselect As String
Dim Kwdikos As Long
Dim dbEPEMBATHS As Database
Dim sum1 As Long
' Make a connection to the database
Set dbEPEMBATHS = CurrentDb
If Not IsNull(Me.OpenArgs) Then
Kwdikos = Me.OpenArgs
End If
' Create a query
strselect = "Select * FROM ANTALLAKTIKA WHERE Kwdikos_episkeyhs =" &
Kwdikos
[Spares_List].RowSource = strselect
strselect = "Select Sum(Kostos) FROM ANTALLAKTIKA WHERE Kwdikos_episkeyhs
=" & Kwdikos
sum1 = dbEPEMBATHS.Execute(strselect)
End Sub
for the OnLoad event of a form I am building. The last statement fails to
compile. How can I correctly rephrase this statement? The general idea is to
fill a list_box with the results of the first query. Then I need to execute
an aggregate query under the condition shown in the code.
Any suggestions?
thx, in advance
George Papadopoulos
Private Sub Form_Load()
Dim strselect As String
Dim Kwdikos As Long
Dim dbEPEMBATHS As Database
Dim sum1 As Long
' Make a connection to the database
Set dbEPEMBATHS = CurrentDb
If Not IsNull(Me.OpenArgs) Then
Kwdikos = Me.OpenArgs
End If
' Create a query
strselect = "Select * FROM ANTALLAKTIKA WHERE Kwdikos_episkeyhs =" &
Kwdikos
[Spares_List].RowSource = strselect
strselect = "Select Sum(Kostos) FROM ANTALLAKTIKA WHERE Kwdikos_episkeyhs
=" & Kwdikos
sum1 = dbEPEMBATHS.Execute(strselect)
End Sub
for the OnLoad event of a form I am building. The last statement fails to
compile. How can I correctly rephrase this statement? The general idea is to
fill a list_box with the results of the first query. Then I need to execute
an aggregate query under the condition shown in the code.
Any suggestions?
thx, in advance
George Papadopoulos