Ben_Entrew
Registered User.
- Local time
- Today, 05:11
- Joined
- Dec 3, 2013
- Messages
- 177
Dear all,
I would like to replace missing TRP information from Query LF with average TRP information coming from Query LF_Average.
Somehow it doesn't work.
Can someone please help me?
Thanks in advance.
I would like to replace missing TRP information from Query LF with average TRP information coming from Query LF_Average.
Somehow it doesn't work.
Can someone please help me?
Thanks in advance.
Code:
Public Sub Replace()
Dim strSQL7 As String
Dim qdf7 As QueryDef
strSQL7 = "SELECT LF_QUERY.*, LF_AVERAGE.Average_TRP_EUR " & _
" FROM LF_QUERY LEFT JOIN LF_AVERAGE ON LF_QUERY.[Product Class] = LF_AVERAGE.[Product Class] " & _
" WHERE (TRP_2013.[new TRP 2013 in EUR]) Is Null"
DoCmd.RunSQL "UPDATE TEMP SET [LF_QUERY.new TRP 2013 EUR] = [LF_AVERAGE.Average_TRP_EUR]"
With CurrentDb
Set qdf7 = CurrentDb.CreateQueryDef("FINAL_LF", strSQL7)
.Close
End With
End Sub