Add Parameters to MAF Shortcut (1 Viewer)

Kodash

Registered User.
Local time
Today, 16:05
Joined
Feb 26, 2014
Messages
22
Hi Guys,

Is there any way to add parameters to a .maf shortcut?

I'm thinking, I may be able to email the link to a form to someone, with the correct ID. But I'm assuming this isn't an easy thing to do?
 

Kodash

Registered User.
Local time
Today, 16:05
Joined
Feb 26, 2014
Messages
22
It's a Microsoft Access Form shortcut file

When you drag a form to the windows desktop and that's the file extension it's given.
 

Kodash

Registered User.
Local time
Today, 16:05
Joined
Feb 26, 2014
Messages
22
There may be an easier way to do it (or it may not be doable). My Goal is to have a button on a form, that sends an email via outlook (or Lotus Notes in an ideal world) with the record ID of the form, so the recipient just clicks the link and the DB opens the form on the correct record.
 

vbaInet

AWF VIP
Local time
Today, 16:05
Joined
Jan 22, 2010
Messages
26,374
Why not create a shortcut to open the db and have the form setup as the Startup Form?
 

Kodash

Registered User.
Local time
Today, 16:05
Joined
Feb 26, 2014
Messages
22
The startup form is a navigation form for all the categories. I'm thinking a better path may be generating some command line switches
 

vbaInet

AWF VIP
Local time
Today, 16:05
Joined
Jan 22, 2010
Messages
26,374
You're going to end up complicating matters. You may end up with 10 forms that need to be opened, and in that case would you go and create 10 shortcuts? Your users should open the db and from the navigation form create a button that opens the form.
 

Kodash

Registered User.
Local time
Today, 16:05
Joined
Feb 26, 2014
Messages
22
No, the plan was Navigation for general use, and the link as just a one off project, I building on what I found here: https://support.microsoft.com/en-us/kb/177475

Where the /cmd would be "3" for example. Then Autoexec opens the form where [ID] = 3
So a button that sends the mail on the form can throw together the /cmd switch
 

vbaInet

AWF VIP
Local time
Today, 16:05
Joined
Jan 22, 2010
Messages
26,374
The only parameters that are contained in an MAF are as follows:

AccessShortcutVersion
DatabaseName
ObjectName
ObjectType
Computer
DatabasePath
EnableRemote
CreationTime
Icon

So as you can see none of them allow you to pass parameters.
The same way a parameter is passed via a normal shortcut is the same way that you would action what should happen next when the navigation form loads with that parameter/command. So in your navigation form's load event, here's some pseudocode:
Code:
With VBA.Interaction
    If .Command <> vbNullString Then
        DoCmd.OpenForm "FormName",,,"ID = " & CLng(.Command)
    End If
End With

Your navigation form is the command centre, so everything should be centred around it.
 

vbaInet

AWF VIP
Local time
Today, 16:05
Joined
Jan 22, 2010
Messages
26,374
Or create a form that goes to that record and then create a shortcut of the form.
 

AccessGary

New member
Local time
Today, 09:05
Joined
Sep 30, 2018
Messages
1
Hi Guys,

Is there any way to add parameters to a .maf shortcut?

I'm thinking, I may be able to email the link to a form to someone, with the correct ID. But I'm assuming this isn't an easy thing to do?

Brilliant Idea. Did you ever figure this out? I did some testing and found that DatabaseName=..\ works FYI if you want to put your MAF's in a sub-folder from your MDB files
 

Users who are viewing this thread

Top Bottom