Opening a report in editing mode via code in a network

  • Thread starter Thread starter Dirk Van waes
  • Start date Start date
D

Dirk Van waes

Hello,

I have a problem with my code, used in a network.

In my db, I have a form where one can choose a course, and then make a
report to control the presences of the students of that course.

Depending on the course, the titles of the colums of that report have to
changes with the right dates. In order to do that, I first open the report
in editing-mode, I then change the headings, save them and open the report
again in preview-mode.

Everything works fine as long as you are the only user of the program.
Otherwise, I get a fault-message, saying that the database isn't opened
exclusive, so I can not make any changes.

Is there not a way to work around this problem?

TIA

Dirk
 
The only way I know to "work around" not being able to make design changes
while multiple users have the database open is to revert to Access 97 or
earlier.

This is one reason that it is recommended that you split the database; that
way, each user can have a separate copy of the front end on his local PC,
while the data remains on the server, accessible to all.

You can also assign values to label captions in the report's Open Event.

HTH
- Turtle
 
Thanks Turtle, I 'll try your second suggestion. I think this
may work. Have a nice week
Dirk
 
Hello,

I have a problem with my code, used in a network.

In my db, I have a form where one can choose a course, and then make a
report to control the presences of the students of that course.

Depending on the course, the titles of the colums of that report have to
changes with the right dates. In order to do that, I first open the report
in editing-mode, I then change the headings, save them and open the report
again in preview-mode.

Everything works fine as long as you are the only user of the program.
Otherwise, I get a fault-message, saying that the database isn't opened
exclusive, so I can not make any changes.

Is there not a way to work around this problem?

TIA

Dirk

I have three workarounds for you, all of which allow you to avoid
making changes to the design of the report:

1) Save the values you want for the column headings into a temporary
table before opening the report. Then have the report reference these
values for the headings.

2) Create hidden textboxs on the form which is calling the report
being opened. Set the values of these hidden textboxes to the values
you want the report headings to be and reference them accordingly

3) Create a class module which stores the values of the headings.
Retrieve those values and set the report headings in code.

You may find one solution easier than the next, but the basic premise
is to store the value you want elsewhere and then retrieve them into
the report allowing it to be more dynamic.

-D
 
Back
Top