Designing a subdata sheet Table View

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to hide Collumn and Row selectors from showing in a
subdata sheet on a form so that you only see the list not collumn header or
row selector. I intend for this to be on a switchboard for a list of Reports
that can be opened via a command button underneath the subdata sheet.
 
Wendy,

You could use the subform in Continuous view.

Your intended usage, though, sounds like something that is more often
done with a listbox.
 
If I used a list box to show the reports how will the command button
underneath the list work in opening each of highlighted reports. When I have
tried it, it only seems to want to open one report. How can you set the
macro so that it can open any of e reports that you highlight in the list.
There's no problem with the edit list button as that will take you to the
list. But when it comes to opening 1 report from the list it's proving to be
a problem. The macro will only let you set up 1 report from the list. I
want to be able to open any of them at the click of the button. (Sorry I
meant to say preview the report/s). I would appreciate you help on this as I
am still a learner when it comes to using visual basic or Building functions
etc. I have no problem with straight forward macro's just the more
complicated one's which may involve group macro's.

Wendy
 
Wendy,

Well, you could use my first suggestion of a continuous view form.

If you use a multi-select listbox, it will be very difficult to manage
this with a macro. You will need to use VBA code to loop through each
ItemData in the listbox's ItemsSelected collection.

But if you were using a datasheet, or a continuous view form for that
matter, how were you proposing to go about selecting and processing more
than one report anyway?
 
Steve

Never got that far so I probably would have ended up in the same position as
now. How do you use VBA code to loop through each itemdata in listbox's
itemSelected collection, as you surgested as I said I am not really up on
using Visual Basic if that's what VBA is so how would I write this out in
what form. I would appreciate your help as I really need to only have 1
button to press to open the report/s when selected. Or am I going to have to
have a button for each separate report. I am just trying to make it easier
for the users to open preset reports for the information that they need. The
information needed is unlikely to change for a long while.
 
Wendy,

Just to clarify, do you mean that the Listbox, or the Form, would be a
list of the names of the reports?
 
Steve

The Form will have on it a list box from a table listing with say 5 reports
(the table listing is the names of the reports from the reports folder with a
autonumbered key).
What I want to do is be able to click on one of the reports from the list
and then click the command button underneath the listing which will open the
report to preview if not preview it, to print it. There will also be another
command button which will enable me to edit the report listing so that I can
if necessary delete a report as it's no longer needed or add a report to the
listing from the reports folder. I don't have a problem with the edit report
command button as that works and takes me to the table listing so that I can
add or delete.
It's being able to open one of the chosen reports from the listing that is
the problem. I can set up one report to view, and that's fine if I don't
need to have a choice from the list, but I would like the person using it to
be able to choose from the list and be able to preview or print the report
they choose from that list.

Hope this explains what I need. I am sure it can be done. As I have seen
something similar in a Access template database called Class Room Management
Database. I had a look at it but was unable to figure it out. it used a
group macro call reports macro, but when you ran the macro, it gave me a
message about there being no report of that name. But then when you clicked
on the button on the form in user view it worked and opened up the report for
previewing. So I have not been able to figure it out. Probably because as I
said I am not that good with Visual basic. If you would like me to e-mail
you the template database so you can see what I mean you will have to supply
me with you e-mail address.

Wendy F

Wendy
 
Wendy,

There area few questions here.

If the report preview opens via the button on the form, but not when you
run the macro directly, well, even when you run the macro directly the
form has to be open, there has to be an item selected in the listbox,
and probably the form itself needs to be the active object. So I
wouldn't worry about this - in normal usage you won't be directly
activating the macro anyway, no?

It is certainly possible to have more than one report previewed at a
time. However, I have never done this, and would tend to avoid this
approach. I am still not clear whether you want to select one report
from the list, and then preview/print it, or whether you want to process
more than one report simultneously. These are two different scenarios.
If you want to do multiple reports, based on selections in a
multi-select format listbox, then I don't know of a way to do this with
a macro. As far as I know, it would require VBA code instead. So, can
you post back with details of the macro you are trying so far?
 
Hi Steve

I think you have missunderstood what I said. The list box is a subdata
sheet on the form (table) and each report in the table is a record of a
report that exists in the reports folder. I first made made the table
consisting of an autonumbering key, Data text, consisting the name of the
report and a 3 collumn consisting of a description of the report. Once the
table was created I then went to the form and used the create list box from
table wizard.

As for the report I don't want to print multi reports at once I just want to
be able to choose a report from the list by highlighting and then click on
the command button below to preview or print the report depending on how what
I the command button has been set up to do which could be either print or
preview, that decision has not been reached yet. All I need to know is how I
can do this.

As I said you will understand what I want to do if you had a look at the
classroom Management data base which show how this type of function works.
Its just I am not able to figure it out from the template. As I said I can
e-mail you the template so you can have a look.
 
Wendy,

Thank you for the further information.

So, this is what you want?...

On the form is a listbox which shows the names of your reports.
On the form also is a command button.
The user will select the name of a report in the listbox, and then click
the button, and the selected report will be printed.

Am I right?

As far as I know, you can't put a listbox on a subdatasheet, so I am not
sure what you mean about this.

But otherwise, to do what you want is very easy.

First of all, remove the Autonumber field from the reports table, this
is confusing and unnecessary.

Put your listbox and command button on the form.

Make sure the listbox is set up so the [Data text] is the first column,
and the listbox's Bound Column property is set to 1.

Make a macro like this...
Action: OpenReport
ReportName: =[NameOfListbox]
View: Print (or Print Preview, depending when you make up your mind)

Close, name, and save this macro.
Assign the macro on the On Click event property of the command button

Of course, you will substitute the actual name of your listbox for the
"[NameOfListbox]" I mentioned in the example above.

Please post back if you need further help.
 
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.

Wendy

Steve Schapel said:
Wendy,

Thank you for the further information.

So, this is what you want?...

On the form is a listbox which shows the names of your reports.
On the form also is a command button.
The user will select the name of a report in the listbox, and then click
the button, and the selected report will be printed.

Am I right?

As far as I know, you can't put a listbox on a subdatasheet, so I am not
sure what you mean about this.

But otherwise, to do what you want is very easy.

First of all, remove the Autonumber field from the reports table, this
is confusing and unnecessary.

Put your listbox and command button on the form.

Make sure the listbox is set up so the [Data text] is the first column,
and the listbox's Bound Column property is set to 1.

Make a macro like this...
Action: OpenReport
ReportName: =[NameOfListbox]
View: Print (or Print Preview, depending when you make up your mind)

Close, name, and save this macro.
Assign the macro on the On Click event property of the command button

Of course, you will substitute the actual name of your listbox for the
"[NameOfListbox]" I mentioned in the example above.

Please post back if you need further help.

--
Steve Schapel, Microsoft Access MVP

Hi Steve

I think you have missunderstood what I said. The list box is a subdata
sheet on the form (table) and each report in the table is a record of a
report that exists in the reports folder. I first made made the table
consisting of an autonumbering key, Data text, consisting the name of the
report and a 3 collumn consisting of a description of the report. Once the
table was created I then went to the form and used the create list box from
table wizard.

As for the report I don't want to print multi reports at once I just want to
be able to choose a report from the list by highlighting and then click on
the command button below to preview or print the report depending on how what
I the command button has been set up to do which could be either print or
preview, that decision has not been reached yet. All I need to know is how I
can do this.
 
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.

Wendy

Steve Schapel said:
Wendy,

Thank you for the further information.

So, this is what you want?...

On the form is a listbox which shows the names of your reports.
On the form also is a command button.
The user will select the name of a report in the listbox, and then click
the button, and the selected report will be printed.

Am I right?

As far as I know, you can't put a listbox on a subdatasheet, so I am not
sure what you mean about this.

But otherwise, to do what you want is very easy.

First of all, remove the Autonumber field from the reports table, this
is confusing and unnecessary.

Put your listbox and command button on the form.

Make sure the listbox is set up so the [Data text] is the first column,
and the listbox's Bound Column property is set to 1.

Make a macro like this...
Action: OpenReport
ReportName: =[NameOfListbox]
View: Print (or Print Preview, depending when you make up your mind)

Close, name, and save this macro.
Assign the macro on the On Click event property of the command button

Of course, you will substitute the actual name of your listbox for the
"[NameOfListbox]" I mentioned in the example above.

Please post back if you need further help.

--
Steve Schapel, Microsoft Access MVP

Hi Steve

I think you have missunderstood what I said. The list box is a subdata
sheet on the form (table) and each report in the table is a record of a
report that exists in the reports folder. I first made made the table
consisting of an autonumbering key, Data text, consisting the name of the
report and a 3 collumn consisting of a description of the report. Once the
table was created I then went to the form and used the create list box from
table wizard.

As for the report I don't want to print multi reports at once I just want to
be able to choose a report from the list by highlighting and then click on
the command button below to preview or print the report depending on how what
I the command button has been set up to do which could be either print or
preview, that decision has not been reached yet. All I need to know is how I
can do this.
 
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Hi Steve

Sorry for mix up I meant the form was named Report Listing and the listbox
was named lstReport (lstReport is started with a lowercase L) but maybe that
it where I should be checking maybe I have inadmittedly done that I and
called the listbox ReportListing will have to check it out and let you know I
will also check spellings to make sure that its all correct. As for using :
in the name section of the Macro that is because the one from the Class Room
Management database was set up like that and as it worked on theirs I wanted
to keep it the same as I did not know whether it would make a difference. On
theirs for the macro to work the form had to be open and a report highlighted
other wise if you tried to run the macro without the form being open you
would get the message switchboard form is either closed or removed please
open and run the macro again.

I have just thought of something which I will have to try!
again I will let you know later. I am at work at the moment and the
database is still under construction at home so I cannot check it out.

Wendy

Steve Schapel said:
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Hi Steve

Sorry for mix up I meant the form was named Report Listing and the listbox
was named lstReport (lstReport is started with a lowercase L) but maybe that
it where I should be checking maybe I have inadmittedly done that I and
called the listbox ReportListing will have to check it out and let you know I
will also check spellings to make sure that its all correct. As for using :
in the name section of the Macro that is because the one from the Class Room
Management database was set up like that and as it worked on theirs I wanted
to keep it the same as I did not know whether it would make a difference. On
theirs for the macro to work the form had to be open and a report highlighted
other wise if you tried to run the macro without the form being open you
would get the message switchboard form is either closed or removed please
open and run the macro again.

I have just thought of something which I will have to try!
again I will let you know later. I am at work at the moment and the
database is still under construction at home so I cannot check it out.

Wendy

Steve Schapel said:
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Hi Again Steve

When I got home I checked the group macros and spelling and everything was
correct. Also what I said a about Report Listing name I was wrong that was
when I was trying it your way which did not work. The listbox done copying
the Classroom Management Database was name lstReport. As I was getting
nowhere I decided to convert the macros within Classroom Management template
to see if it would make more sence to you if you see it in Visual basic
format so here goes
------------------------------------------------------------------------------------------------
View_Report_Macros_cmdOpenReport___On_Clic
------------------------------------------------------------------------------------------------
Function View_Reports_Macros_cmdOpenReport___On_Click( )
On Error GoTo View_Reports_Macros_cmdOpenReport___On_Click_Err

DoCmd.OpenReport Forms ! [View Reports] ! lstReports, acViewPreview, "", "",
acNormal

View_Report_Macros_cmdOpenReport___On_Click_Exit:
Exit Function

View_Report_Macros_cmdOpenReport___On_Click_Err:
MsgBox Error$
Resume View_Report_Macros_cmdOpenReport___On_Click_Exit

End Functio
------------------------------------------------------------------------------------------------
View_Reports_Macros_EditReportList___On_Clic
------------------------------------------------------------------------------------------------
Function View_Reports_Macros_EditReportList___On_Click( )
On Error GoTo View_Reports_Macros_EditReportList___On_Click_Err

DoCmd.OpenForm "Reports", acFormDS, "", "", , acNormal

View_Reports_Macros_EditReportList___On_Click_Exit:
Exit Function

View_Reports_Macros_EditReportList___On_Click_Err:
MsgBox Error$
Resume View_Reports_Macros_EditReportList___On_Click_Exit

End Functio
-----------------------------------------------------------------------------------------------
View_Reports_Macros_lstReports___On_Dbl_Clic
-----------------------------------------------------------------------------------------------
Function View_Reports_Macros_lstReports___On_Dbl_Click( )
On Error GoTo View_Reports_Macros_lstReports___On_Dbl_Click_Err

DoCmd.OpenReport Forms ! [View Reports] ! lstReports, acViewPreview, "", "",
acNormal

View_Reports_Macros_lstReports___On_Dbl_Click_Exit:
Exit Function

View_Reports_Macros_lstReports___On_Dbl_Click_Err:
MsgBox Error$
Resume View_Reports_Macros_lstReports___On_Dbl_Click_Exit

End Function

Does this make anymore sense to you now it's in Visual Basic. I hope so
because I am totally lost I guess I am going to have to study up on Visual
Basic more throughly. I really need for this to work. Again all spelling
was checked and as far as I can see everything was right. I hope you can
figure this out and get back to me. I don't know what else to do other than
attaching a macro for each individual report within the list which if you
have say 15 standard reports would be 15 macro command buttons to setup which
is a lot.

Wendy

Steve Schapel said:
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Hi Again Steve

When I got home I checked the group macros and spelling and everything was
correct. Also what I said a about Report Listing name I was wrong that was
when I was trying it your way which did not work. The listbox done copying
the Classroom Management Database was name lstReport. As I was getting
nowhere I decided to convert the macros within Classroom Management template
to see if it would make more sence to you if you see it in Visual basic
format so here goes
------------------------------------------------------------------------------------------------
View_Report_Macros_cmdOpenReport___On_Clic
------------------------------------------------------------------------------------------------
Function View_Reports_Macros_cmdOpenReport___On_Click( )
On Error GoTo View_Reports_Macros_cmdOpenReport___On_Click_Err

DoCmd.OpenReport Forms ! [View Reports] ! lstReports, acViewPreview, "", "",
acNormal

View_Report_Macros_cmdOpenReport___On_Click_Exit:
Exit Function

View_Report_Macros_cmdOpenReport___On_Click_Err:
MsgBox Error$
Resume View_Report_Macros_cmdOpenReport___On_Click_Exit

End Functio
------------------------------------------------------------------------------------------------
View_Reports_Macros_EditReportList___On_Clic
------------------------------------------------------------------------------------------------
Function View_Reports_Macros_EditReportList___On_Click( )
On Error GoTo View_Reports_Macros_EditReportList___On_Click_Err

DoCmd.OpenForm "Reports", acFormDS, "", "", , acNormal

View_Reports_Macros_EditReportList___On_Click_Exit:
Exit Function

View_Reports_Macros_EditReportList___On_Click_Err:
MsgBox Error$
Resume View_Reports_Macros_EditReportList___On_Click_Exit

End Functio
-----------------------------------------------------------------------------------------------
View_Reports_Macros_lstReports___On_Dbl_Clic
-----------------------------------------------------------------------------------------------
Function View_Reports_Macros_lstReports___On_Dbl_Click( )
On Error GoTo View_Reports_Macros_lstReports___On_Dbl_Click_Err

DoCmd.OpenReport Forms ! [View Reports] ! lstReports, acViewPreview, "", "",
acNormal

View_Reports_Macros_lstReports___On_Dbl_Click_Exit:
Exit Function

View_Reports_Macros_lstReports___On_Dbl_Click_Err:
MsgBox Error$
Resume View_Reports_Macros_lstReports___On_Dbl_Click_Exit

End Function

Does this make anymore sense to you now it's in Visual Basic. I hope so
because I am totally lost I guess I am going to have to study up on Visual
Basic more throughly. I really need for this to work. Again all spelling
was checked and as far as I can see everything was right. I hope you can
figure this out and get back to me. I don't know what else to do other than
attaching a macro for each individual report within the list which if you
have say 15 standard reports would be 15 macro command buttons to setup which
is a lot.

Wendy

Steve Schapel said:
Wendy,

I am sorry, I can't give a definitive answer here. But it is sure to be
some little details somewhere not right.

I am not saying this is the problem... I don't know what the effect
would be. But I would not use a : as part of the name of a macro (or
any other database object for that matter).

Also, I would not use the Dbl Click event of a listbox. Is that what
they did in the database template you were basing your work on?

The other thing I noticed is the inconsistency in the naming in the
information you gave here. For example, you said in your descripion
that the listbox is named "Report listing", whereas in the macro details
you show it as "lst Reports", yet further down you say it is named
"lstReport". 3 completely different names for the same thing. You are
probalbly just being careless in your posting here, but accuracy with
these types of details are critical, so it makes me wonder whether the
problem lies with a spelling mistake somwhere along the line.

--
Steve Schapel, Microsoft Access MVP


Wendy said:
Hi Steve

The List box has been put directly onto the form, sorry I don't know why I
said on a subdata sheet, but I am still having problems, I tried your
surgestion but it did not work. It said it could not find the report named
Report listing which is what I called my listbox with my reports listed in
it. I tried several times following your instruction carefully each time
still no joy. I got the message switch form out of string space what ever
that means. So I decided to go back to the example that does work in the
template Classroom Management database and see if I could figure out how that
one worked. I followed everything that was set up in that database and did
the same just substituting my listing and named reports etc instead but
basically using everything else the same the following is how it is set up.

the list box was made from a table/query with the row source as 'Add or
Delete Reports' which is what the query was saved as. It had a default value
set up so I did the same from my lists of reports.
A group macro named View Reports Macros was made up of the following macro
names and actions:

Name Action Report Name:
cmdOpenReport : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (view: print preview, window mode: Normal)

EditReportList : On Click OpenForm Reports
(View: Datasheet, Data mode: Edit, Window mode: Normal)

lstReports : On Click OpenReport =[Forms]![View
Reports]![lst Reports] (View: print preview, Window mode: Normal)

the command button for previewing the report chosen was named cmdOpenReport
with the caption &Open Report
the command button for editing the listing was named EditReportList with the
caption as &Edit Report List....
the listbox was named lstReport

In the on click section of the command button field options was typed:
View Report Macros.cmdOpenReport : On Click
In the list box field option for on Dbl Click was typed:
View Reports Macros.lstReport : On Click
In the on Click field options for th command button of the edit report was
typed:
View Reports Macros.EditReportList : On Click

As I said other than subsituting my set for the other it should have worked
but it did'ent I got the message Switch Board Form A problem occurred white
switchboard form was communicating with the OLE Server or ActiveX control
Close the OLE server & restart it outside of switch board form then try the
original operation again in switch board form. each time a tried to execute
the command. What it wrong with it, it should work but it dos'ent. I am
ready to give up on this. Please help.
 
Wendy,

No, it doesn't really help to see it converted to VBA, as the
relationship between macros and VBA is very loose.

I am still confused about your naming. You told me the name of the form
was Report Listing but in your macro it seems you are referring it as
View Reports. We have to get this right.
 
Wendy,

No, it doesn't really help to see it converted to VBA, as the
relationship between macros and VBA is very loose.

I am still confused about your naming. You told me the name of the form
was Report Listing but in your macro it seems you are referring it as
View Reports. We have to get this right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access subdata sheet 2
How to expand a subdata only for the currrent record? 1
Printing Subdatasheet in a Table 2
Subform Help 3
Printing a Report 3
Table Design 5
Sum Function Error 1
Subdata Sheets 1

Back
Top