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

Make text box visible dependant on dates entered

Status
Not open for further replies.

gavin31

Programmer
Mar 14, 2004
28
IE
Ok.....will try to keep this brief.

User enters start and end dates onto form (frmJobHours).

Report (rptJobHours) shows records between those dates.

Text box on rptJobHours (called remainingBudget) has a calculated value equaling total budget minus total of expenses in all records on report. This all works fine.

My problem is I want to make this remainingBudget visible only when start date is before date of the first record on the report, and end date is after the date of the last record on the report.

Any ideas how I might do this

Cheers

Gavin
 
How about setting the visible property of remainingBudget to false, then just a simple if statement along the lines of:

if me.startdate < me.recordstart and me.enddate > me.recordend then
me.remainingBudget.visible = true
else: me.remainingBudget.visible = false
End if

or is that too simplistic?

Regards

MD

 
Mobyduck

I agree with your logic, my problem however is how to reference the first and last records in the report.

i.e. in your code where you state me.recordstart and me.recordend

Cheers

Gavin
 
Hi Gavin,

I must be missing something here...

I've re-read your original posting, and I'm struggling to see what the report does. If you enter a start and end date on a form and run the report from a query on these dates, then the individual records must have a date field somewhere that is being referenced so you use this field.

Also thinking about it, if this is the case then the query won't return any records outside of the dates on the form so you won't ever have the situation of records before or after the dates... I think I'm more confused than ever now.

Can you post anymore details ??

Regards

MD
 
mobyduck said:
...if this is the case then the query won't return any records outside of the dates on the form so you won't ever have the situation of records before or after the dates...

Aaah! Yes! Good point...

To try and explain fully what I am trying to do with this report would make this thread very long and boring.

I think I'll leave it here and have a rethink.

Thanks for the advice though...

Cheers

Gavin


Closed Thread..........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top