Application - Forms

  • Thread starter Thread starter NickH
  • Start date Start date
N

NickH

Hi

I have had great difficulty in finding a way to run a
third party application from within a form/subform,using
a "Command Button" and still being able to enter and /or
go into any part of Access. the only way is to close the
third party application.

So I am looking at writing a Module, which will open the
third party application when the database is opened and
then for this application to retrieve the HPGL Data in
the appropriate field within a Subform using a Command
Button if this is possible.
Essentially, I would like to be able to retrieve Graphic
data from Access using a third party software
application, and still have the ability to open/edit any
part of the same database which at present I cannot do.

One alternative would be to to extract the HPGL Data from
a field within a Table.
I hope I have made my self clear, if not I will explain
more.

TKS

Nick
 
NickH said:
Hi

I have had great difficulty in finding a way to run a
third party application from within a form/subform,using
a "Command Button"

You can easily code a command button to run any named program on your PC.
Check out the SHELL command in online help, for one way to do it.

and still being able to enter and /or
go into any part of Access. the only way is to close the
third party application.

Huh? In what way can you not "enter and/or go into" other parts of Access?
No-one understand what you mean by this.

So I am looking at writing a Module, which will open the
third party application when the database is opened and
then for this application to retrieve the HPGL Data in
the appropriate field within a Subform using a Command
Button if this is possible.
Essentially, I would like to be able to retrieve Graphic
data from Access using a third party software
application, and still have the ability to open/edit any
part of the same database which at present I cannot do.

One alternative would be to to extract the HPGL Data from
a field within a Table.
I hope I have made my self clear, if not I will explain more.

Sorry - no! You need to be much more clear about what you are trying to do.
I suggest that you forget about implementation details like subforms &
modules & command buttons for the moment, and describe what you are trying
to achieve from a functional viewpoint.

HTH,
TC
 
Hi

Below is code taken from the "OnClick" function of a
command button within a Sub-form called Plots.
This Sub-form resides along side six other Sub-forms
within the Details section of a main form called Session
Header.I require to be able to go into any of these
subforms at any given time, unfortunately I have one
problem which prevents me from doing this and it occurs
when I am in the Subform "Plots", if I select one of the
Records of this subform and retrieve the data using a
Graphics Software Application, although it pulls up the
plot onto the screen I cannot then go into any of the
other subforms to analyse the data for the Plot I select.
The small Routine as mentioned previously is shown here:

Private Sub RunPlottergeist_Click()
On Error GoTo Err_RunPlottergeist_Click
Dim Freq As String
Dim Plottergeist As PltgeistX
Set Plottergeist = CreateObject("Pltgeist.PltgeistX")

'Sets Plottergeist to run in mode for resultant Plot for
this application
Plottergeist.Window_State "Norm"
HPGL_Data.SetFocus
Plottergeist.AddHPGL (HPGL_Data.Text) 'HPGL data
Originating from HP Analyzer
Plottergeist.CopyGraphicToClipBoard 'Note. Max of 24 Plots

'AppActivate "Microsoft Access"
'DoCmd.GoToControl "SignalPassFail"
'Freq.SetFocus
'Assistant.Reduced = True


MsgBox ("Click To Close Plottergeist")
Plottergeist.CloseApp

Exit_RunPlottergeist_Click:
Exit Sub

Err_RunPlottergeist_Click:
MsgBox Err.Description
Resume Exit_RunPlottergeist_Click

End Sub

Once the command button has been selected the graphics
software opens and retrieves the data producing a plot,
however as explained above, until I close this package
again using the "OK" button on the Message Box "Click to
Close Plottergeist" I cannot look at any other data
within the other subforms, the main form, or to Access
the rest of the Database.

I have tried Deleting the Message box, but this does not
cure the problem since another message box appears,
"Microsoft Access", with a OK Button.

From a functional view point or aim, we need to select
any one or more records on the main Form, then to
retrieve a graphics image for those records, and to
analyse other data within the database.
Therefore it requires more than one Graphics image to be
displayed and at the same time to be able to analyse
other data within the database.
Finally, we are trying to reduce the amount of steps we
have to use to retrieve, analyse and save the right
Graphics plots with the right data.


I hope this helps

p.s. I am a novice when it comes to VB
 
That's much clearer, Nick.

See answers within your text below.



NickH said:
Hi

Below is code taken from the "OnClick" function of a
command button within a Sub-form called Plots.
This Sub-form resides along side six other Sub-forms
within the Details section of a main form called Session
Header.I require to be able to go into any of these
subforms at any given time, unfortunately I have one
problem which prevents me from doing this and it occurs
when I am in the Subform "Plots", if I select one of the
Records of this subform and retrieve the data using a
Graphics Software Application, although it pulls up the
plot onto the screen I cannot then go into any of the
other subforms to analyse the data for the Plot I select.
The small Routine as mentioned previously is shown here:

Private Sub RunPlottergeist_Click()
On Error GoTo Err_RunPlottergeist_Click
Dim Freq As String
Dim Plottergeist As PltgeistX
Set Plottergeist = CreateObject("Pltgeist.PltgeistX")

'Sets Plottergeist to run in mode for resultant Plot for
this application
Plottergeist.Window_State "Norm"
HPGL_Data.SetFocus
Plottergeist.AddHPGL (HPGL_Data.Text) 'HPGL data
Originating from HP Analyzer
Plottergeist.CopyGraphicToClipBoard 'Note. Max of 24 Plots

'AppActivate "Microsoft Access"
'DoCmd.GoToControl "SignalPassFail"
'Freq.SetFocus
'Assistant.Reduced = True

MsgBox ("Click To Close Plottergeist")
Plottergeist.CloseApp

Exit_RunPlottergeist_Click:
Exit Sub

Err_RunPlottergeist_Click:
MsgBox Err.Description
Resume Exit_RunPlottergeist_Click

End Sub

Once the command button has been selected the graphics
software opens and retrieves the data producing a plot,
however as explained above, until I close this package
again using the "OK" button on the Message Box "Click to
Close Plottergeist" I cannot look at any other data
within the other subforms, the main form, or to Access
the rest of the Database.

The reason for that is simple. A message box provides a so-called "modal"
message. With a modal message, nothing else can happen in Access, until you
"dismiss" that message by clicking one of the buttons provided with it (OK,
Cancel, Yes, No, or whatever). This is why you can not go to any of the
subforms (or to anywhere else!) while the message box is still displayed.

I have tried Deleting the Message box, but this does not
cure the problem since another message box appears,
"Microsoft Access", with a OK Button.

The solution to your problem, would be this.

- Remove the following three lines from Private Sub RunPlottergeist_Click().
Dim Plottergeist As PltgeistX
MsgBox ("Click To Close Plottergeist")
Plottergeist.CloseApp

- Add the following line right at the top of the module, just below any
Option statements (eg. Option Compare Database):
Private Plottergeist As PltgeistX

- Create a new command button called ClosePlottergeist with caption "Close
Plottergeist".

- In the Click event of the new button, say:
Plottergeist.CloseApp

Then, clicking RunPlottergeist will start Plottergeist, and clicking
ClosePlottergeist will stop it.

HTH,
TC
 
Back
Top