Check Box on forms

A

Alex

Hi Everybody,

First of all thank you all for your work.

I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.
 
N

Nikos Yannacopoulos

Alex,

Start making a new form in design view (not using the wizard!).

Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.

Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:

Private Sub cmdPreviewReport_Click()

End Sub

Paste the following code between them:

If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview

Close the VBA window, and return to the form design; save and you're done.

HTH,
Nikos
 
A

Alex

Dear Nikos,
Everything works perfectly THX A LOT
but what on earth the

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;

means???

I know that SELECT is SQL command which retrieves the neseccary data from
tables and I know that FROM is used to define the path from which tables we
need the data and that the WHERE is the additional criteria, but what
MsysObjects means? and what' that -32764???

if it's not difficult for you please make me clear

Thank you very very much once again.


Nikos Yannacopoulos said:
Alex,

Start making a new form in design view (not using the wizard!).

Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.

Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:

Private Sub cmdPreviewReport_Click()

End Sub

Paste the following code between them:

If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview

Close the VBA window, and return to the form design; save and you're done.

HTH,
Nikos
Hi Everybody,

First of all thank you all for your work.

I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.
 
N

Nikos Yannacopoulos

Alex,

MSysObjects is a system table which lists all objects in your .mdb. It
has many fields, among which Name and Type. The SQL expression is
simply a query on the table, filtering objects of type -32764 (reports).

To see the table (along with all other hidden objects), go Tools >
Options, tab General, and click Hidden Objects in group View.

HTH,
Nikos
Dear Nikos,
Everything works perfectly THX A LOT
but what on earth the

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;


means???

I know that SELECT is SQL command which retrieves the neseccary data from
tables and I know that FROM is used to define the path from which tables we
need the data and that the WHERE is the additional criteria, but what
MsysObjects means? and what' that -32764???

if it's not difficult for you please make me clear

Thank you very very much once again.


:

Alex,

Start making a new form in design view (not using the wizard!).

Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.

Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:

Private Sub cmdPreviewReport_Click()

End Sub

Paste the following code between them:

If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview

Close the VBA window, and return to the form design; save and you're done.

HTH,
Nikos
Hi Everybody,

First of all thank you all for your work.

I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.
 
A

Alex

DEAR Nikos,

Thank you for your help, i really needed it.
TOOLS>OPTIONS>View Tag> System Objects I found out all objects
Think you should be the MSAccess Expert.

Once again thank you, I am really appreciate for your help.

Nikos Yannacopoulos said:
Alex,

MSysObjects is a system table which lists all objects in your .mdb. It
has many fields, among which Name and Type. The SQL expression is
simply a query on the table, filtering objects of type -32764 (reports).

To see the table (along with all other hidden objects), go Tools >
Options, tab General, and click Hidden Objects in group View.

HTH,
Nikos
Dear Nikos,
Everything works perfectly THX A LOT
but what on earth the

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;


means???

I know that SELECT is SQL command which retrieves the neseccary data from
tables and I know that FROM is used to define the path from which tables we
need the data and that the WHERE is the additional criteria, but what
MsysObjects means? and what' that -32764???

if it's not difficult for you please make me clear

Thank you very very much once again.


:

Alex,

Start making a new form in design view (not using the wizard!).

Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.

Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:

Private Sub cmdPreviewReport_Click()

End Sub

Paste the following code between them:

If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview

Close the VBA window, and return to the form design; save and you're done.

HTH,
Nikos

Alex wrote:

Hi Everybody,

First of all thank you all for your work.

I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.
 
N

Nikos Yannacopoulos

Glad to help. If you hang around the NG's (which I'm sure you will), you
will soon know the real experts!

Nikos
DEAR Nikos,

Thank you for your help, i really needed it.
TOOLS>OPTIONS>View Tag> System Objects I found out all objects
Think you should be the MSAccess Expert.

Once again thank you, I am really appreciate for your help.

:

Alex,

MSysObjects is a system table which lists all objects in your .mdb. It
has many fields, among which Name and Type. The SQL expression is
simply a query on the table, filtering objects of type -32764 (reports).

To see the table (along with all other hidden objects), go Tools >
Options, tab General, and click Hidden Objects in group View.

HTH,
Nikos
Dear Nikos,
Everything works perfectly THX A LOT
but what on earth the

SELECT [MSysObjects].[Name] FROM MSysObjects WHERE


[MSysObjects].[Type]=-32764;


means???

I know that SELECT is SQL command which retrieves the neseccary data from
tables and I know that FROM is used to define the path from which tables we
need the data and that the WHERE is the additional criteria, but what
MsysObjects means? and what' that -32764???

if it's not difficult for you please make me clear

Thank you very very much once again.


:



Alex,

Start making a new form in design view (not using the wizard!).

Add a listbox; as soon as the wizard opens, click Cancel. Then select
the listbox and open the Properties window (View > Properties, or right
click); select tab Data, and paste the following expression in the Row
Source property:
SELECT [MSysObjects].[Name] FROM MSysObjects WHERE
[MSysObjects].[Type]=-32764;
(all in one line, in case it gets wrapped in your newsreader)
Then select tab Other, and change the Name property from the default
(probably List0) to lstReports.

Next, add a command button; again, as soon as the wizard opens, click
Cancel. Like before, change the Name property from the default (probably
Command2) to cmdPreviewReport. Then go to tab Events and put the cursor
in the On Click property; click on the little button with the three dots
that appears on the right, and select Code Builder. You will be taken to
the VBA editor screen, and the cursor will be between two lines that
look like:

Private Sub cmdPreviewReport_Click()

End Sub

Paste the following code between them:

If IsNull(Me.lstReports) Then Exit Sub
DoCmd.OpenReport Me.lstReports, acPreview

Close the VBA window, and return to the form design; save and you're done.

HTH,
Nikos

Alex wrote:


Hi Everybody,

First of all thank you all for your work.

I am interesting in follows:
Have a small DataBase with tables, queries and several reports, want to make
a form with the Check Boxes and a button for choosing which report to
preview. Is it possible?
if it is please help me with this.
 
Top