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!

problem assigning value to text box in report on open

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
US
Hi. In my main report I have:

Page Header:
lblreports - Shows the monthly report heading which includes the month and year prompted for
txtMthYear - want this to contain the month and year prompted for so I can use it as a link between all the subreports

I keep getting an error message on the txtMthYear portion saying it cannot assign a value to this object but I dont' see why?
Code:
This is the on open event
  dteStart = Month(Date) & "/" & Year(Date)
  
    strStart = InputBox("Enter Start Date Range:", "Start Date (month/year)", dteStart)
    If IsDate(strStart) Then dteStart = strStart
    
 
    lblReportDates.Caption = " METER SHOP MONTHLY REPORT - " & Format(dteStart, "mmmm yyyy")    
    Debug.Print strStart
    Me.txtMthYear = dteStart     [b[COLOR=#EF2929]]======== Line I get the error on[/color][/b]
what am I doing wrong??
Thanks
 
First, I would never use InputBox() or parameters faq701-6763.

Then, I would move the code to the On Format event of the section of the report containing txtMthYear.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top