Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting fields filled from query

Status
Not open for further replies.

HVtech

IS-IT--Management
Jul 1, 2010
71
NL
Hi I have a fine working query. Now I want to set the results to some fields on a report based on another field on the same report.
I not getting it right, who can help me out here?
Thanks in advance..
Code:
 Dim StrSQL As String

StrSQL = "SELECT DISTINCT registratie.periode, " & _
"periode.Periode_startdatum, periode.Periode_einddatum " & _
"FROM periode INNER JOIN registratie ON periode.Periode_naam = registratie.periode " & _
"WHERE (((registratie.periode)=[Rapporten]![Rpt_Tot_Project_uren]![periode]))"

DoCmd.RunSQL StrSQL

Me!Pstartdatum = Periode_startdatum
Me!Peinddatum = Perode_einddatum

Me!eindweek = DatePart("ww", [Periode_einddatum], 2, 2)
Me!Week = DatePart("ww", [Periode_startdatum], 2, 2)
 
I think you need to start at the beginning. The RunSQL will have no value since it's a basic select query. There is a difference between fields which are basically columns from your data source and controls which display values from fields and expressions.

Is there a report created?
Does it have a record source?


Duane
Hook'D on Access
MS Access MVP
 
Hm oke.. thanks for your answers.
I will start over I think..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top