Updating a control source

  • Thread starter Thread starter Mark Gough
  • Start date Start date
M

Mark Gough

Hi,

I am trying to automate a report based on values that are inputted through a
form. The form element works fine but then using these values in an IF
statement to determine the ControlSource has many BUGS. I am sure it is
something simple. An ideas?

This is what I'm trying to use:

If [Week] = ("Week 1") And [Number] = (1) Then
Reports![HomeworkReport].RecordSource = "Homework Entry"
Reports![HomeworkReport]![Timestables] = (1)
End If

Mark
 
A string of "Homework Entry" seems an unusual RecordSource -- what do you
intend? Why are all your numeric values parenthesized? Where are you trying
to execute this code? In what Report section is the control [Timestables]?
If you are experiencing errors, it is helpful if you will describe the one
you see with the exact code that you copy and include here -- "many BUGS"
does not give us much to work on.

The RecordSource of a Report can be changed with the Report open in Design
View, or in the Open event _only_ at runtime. If "Homework Entry" is a
query, then your syntax is wrong. And, I am not sure that the Controls on
the Report are available yet, in the Open event.

Please clarify and perhaps someone will be able to help.

Larry Linson
Microsoft Access MVP
 
Back
Top