Desktop Program

P

Peg

I don't know how to search for what I'm trying to do because I don't know
what to call it: I'd like the Access Form I've made to be available on my
desktop sort of like an application, where I can click on it and start using
it without having to open Access or have Access on the computer I'm working
from.

Does anyone have any ideas how to do this?
 
D

Dirk Goldgar

Peg said:
I don't know how to search for what I'm trying to do because I don't know
what to call it: I'd like the Access Form I've made to be available on my
desktop sort of like an application, where I can click on it and start
using
it without having to open Access or have Access on the computer I'm
working
from.

Does anyone have any ideas how to do this?


You can't do it without *some* form of Access on the computer: either the
full version or the runtime module, which is basically Access without the
built-in user-interface. For Access 2007, the runtime can be downloaded
from Microsoft for free, but for earlier versions you have to buy the
devleoper's edition or developer's toolkit (its name varies from version to
version) in order to get the runtime and a license to distribute it.

With full Access on the PC -- I'm not sure about the runtime, but this
probably still works -- it's possible to make a shortcut to the form in the
database, such that double-clicking on the form will open Access, the
database, and the form. That may be what you want.

It's also possible, with VBA code in the database, to set it up so that when
opened it hides the Access application window and shows only the form. This
is a bit tricky and limits what you can do, but for one-form applications it
can be handy. Note that Access is still running; it's just that its window
and menus are hidden.
 
P

Peg

I don't mind using Access at all, but if I end up trying to use the Access
Form I made on a computer that doesn't have Access then I have a problem. I
did download the Runtime add-on and installed it, but everytime I try to use
the Wizard to put it on a CD, Access crashes.

I guess my question is this: how do I turn my Access Form into an
Application?
 
P

Peg

Your suggestion is closer to what I want to do. It's ok if Access is running
in the background, but I'd like to open and use the Access Form that I made
directly from the desktop.

I just have no clue how to make that happen. I don't know what to call what
I'm trying to do so I can't even really consult the Help file.
 
R

Rick Brandt

Peg said:
I don't mind using Access at all, but if I end up trying to use the
Access Form I made on a computer that doesn't have Access then I have
a problem. I did download the Runtime add-on and installed it, but
everytime I try to use the Wizard to put it on a CD, Access crashes.

I guess my question is this: how do I turn my Access Form into an
Application?

You cannot other than to re-create it using a development tool designed to
create executable programs.
 
R

Rick Brandt

Peg said:
Your suggestion is closer to what I want to do. It's ok if Access is
running in the background, but I'd like to open and use the Access
Form that I made directly from the desktop.

I just have no clue how to make that happen. I don't know what to
call what I'm trying to do so I can't even really consult the Help
file.

With your app opened, drag the form to the desktop and a shortcut will be
created.

That shortcut will...

Open Access
Open your file
Open your form

If you want to hide the Access window that is a different topic and the
method to do that is described here...

http://www.mvps.org/access/api/api0019.htm

Using the runtime is also a completely separate issue really having nothing
to do with the above. If you get the above to behave as desired with
regular Access it should also work with the runtime except that you will not
be able to use the runtime to create the shortcut.
 
D

Dirk Goldgar

Peg said:
Your suggestion is closer to what I want to do. It's ok if Access is
running
in the background, but I'd like to open and use the Access Form that I
made
directly from the desktop.

I just have no clue how to make that happen. I don't know what to call
what
I'm trying to do so I can't even really consult the Help file.


The help file wouldn't help you here, because this isn't the way Access is
designed to work. However, you can approach it two different ways:

1. You can size the form to the Access application window, or resize the
application window to just fit the form. The former can be done using the
code here:

http://www.mvps.org/access/api/api0022.htm

The latter can be done using Nicole Calinoiu's FormWindow class, posted
here:

http://www.mvps.org/access/forms/frm0042.htm

With that class module in your database, your form could have code like this
in its Open event:

Dim fwForm As New clFormWindow
Dim fwApp As New clFormWindow
Dim fwInside As clFormWindow
Dim lngVerticalOffset As Long
Dim lngHorizontalOffset As Long

fwForm.hwnd = Me.hwnd
Set fwInside = fwForm.Parent
fwApp.hwnd = hWndAccessApp

lngVerticalOffset = (fwApp.Height - fwInside.Height) + 10
lngHorizontalOffset = (fwApp.Width - fwInside.Width) + 10

With fwApp
.top = fwForm.top + lngVerticalOffset
.Left = fwForm.Left + lngHorizontalOffset
.Height = fwForm.Height + (lngVerticalOffset - 6)
.Width = fwForm.Width + (lngHorizontalOffset - 6)
End With

fwForm.top = 0
fwForm.Left = fwInside.Left


2. You can hide the application window completely by calling a Windows API
function, as described here:

http://www.mvps.org/access/api/api0019.htm

It mentions in that article that your form's PopUp property must be set to
Yes. On top of that, in recent versions of Windows your form's Modal
property must also be set to Yes. With that code saved in a module in your
database, you would set your form as the application's startup form, and
then have code like this in the form's Open event:

Private Sub Form_Open(Cancel As Integer)
Me.Visible = True
DoEvents
fSetAccessWindow SW_HIDE
End Sub
 
Top