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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms!RevenueForm!StartDate in reports?

Status
Not open for further replies.

Olddogg1

IS-IT--Management
Aug 12, 2005
21
CA
Hi guys,

I built a user-interactive form for our company revenue database. One of the features is to enter a "startdate" and "enddate" and then click a command button.

I currently have this code in the detail_print section of my report's VBA:

Code:
    StartDate = "#" & Forms!RevenueMain!Startmm & "/" & Forms!RevenueMain!Startdd & "/" & Forms!RevenueMain!Startyyyy & "#"
    EndDate = "#" & Forms!RevenueMain!Endmm & "/" & Forms!RevenueMain!ENDdd & "/" & Forms!RevenueMain!ENDyyyy & "#"

These two variables are used directly in the SQL statements.

[!]PROBLEM:[/!]

It seems that these fields aren't refreshing. My reports seem to be lagged. I must switch back and forth in and out of design view a few times before they work.

I have tried a few variations of .requery

Any Suggestions? Thanks in advance.

Sorry for the newbian question.

Jon
 
Are you requiring users to enter values into 6 controls to get 2 dates? Consider creating hidden text boxes on the form RevenueMain that performs the date calculation like:
Name: txtStartDate
Control Source: = DateSerial(Startyyyy, Startmm,Startdd)

Then set the control source of a text box in your report to:
= Forms!RevenueMain!txtStartDate

Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top