Not able view the table in report view, called from a button in a form (1 Viewer)

SachAccess

Active member
Local time
Today, 06:02
Joined
Nov 22, 2021
Messages
389
Hi,

I have changed real names in below example.
Am trying to open a table with button provided in a form.
' DoCmd.OpenTable "tbl_Dummy", acViewReport, acReadOnly 'Not working'
This line is not working for me.

I tried editing it too but not able to succeed. Doing it for the first time.
Can anyone please help me in this.

Code:
Option Compare Database
Option Explicit
Private Sub Command0_Click()
    DoCmd.OpenTable "tbl_Dummy", acViewNormal, acReadOnly 'Will open as normal table in read-only mode
    DoCmd.OpenTable "tbl_Dummy", acViewPivotChart, acEdit 'Did not see any Pivot chart
    DoCmd.OpenTable "tbl_Dummy", acViewReport, acReadOnly 'Not working
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:32
Joined
May 7, 2009
Messages
19,249
acViewReport only applicable in Reports.
acViewPivotChart, there is no more pivot chart in newer msa.
 

SachAccess

Active member
Local time
Today, 06:02
Joined
Nov 22, 2021
Messages
389
acViewReport only applicable in Reports.
acViewPivotChart, there is no more pivot chart in newer msa.
Thanks a lot for the help. Have a nice day ahead. :)
 

SachAccess

Active member
Local time
Today, 06:02
Joined
Nov 22, 2021
Messages
389
Hi,
One more doubt regarding the table. Tried searching it on Google too but could not get it.
Above code opens the table without any issue. How do I auto-clos this table when not active.
For example, opening this table if I move to a form then how do I auto-close this table.
Can anyone please help in this.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:32
Joined
May 7, 2009
Messages
19,249
you need a Form for you table.
on the Form add Timer Event.
When the Timer reaches its "countdown", check if the Current Hwnd (Window handle) is
different from that of your form. if it is Close the form.
 

SachAccess

Active member
Local time
Today, 06:02
Joined
Nov 22, 2021
Messages
389
you need a Form for you table.
on the Form add Timer Event.
When the Timer reaches its "countdown", check if the Current Hwnd (Window handle) is
different from that of your form. if it is Close the form.
Thanks for the help. :)
 

Users who are viewing this thread

Top Bottom