Displaying form as datasheet view from Switchboard

KasperBN

Registered User.
Local time
Today, 13:43
Joined
Jan 17, 2013
Messages
48
Hello, I have tried finding a solution to this problem, but cannot seem to do so.

Keep in mind, I am a big time novice with Access 2010 and databases in general, but have managed to build up a 'decent' one from scratch without knowing much. However I have encountered a problem I can not seem to fix.

I have made a switchboard so that the users of this database can access various forms quickly, and without much knowledge, however some of these forms need to open in datasheet view so they can be exported to Excel. From what I have read, it seems Microsoft does not allow this, as it will open in Split Form or another Form view, but not datasheet.

Is there a way around this, while still using this Switchboard? Keep in mind my level of expertise, with a solution:) I am a quick learner, but I need to have the basic steps, if anyone would be so kind.

I have read somewhere that making a macro for this is possible, but how would this be done?

Thank you in advance!

Kasper Bülow
 
Okay, so here's what I would do.

1. Create a new Standard MODULE (CREATE tab then OTHER then little arrow on Macro button to select MODULE).

2. Save that module as basCode

3. In that module create a FUNCTION (not sub) like this:

Code:
Function OpenMyXForm()
    DoCmd.OpenForm "YourFormNameHere", acFormDS
End Function

4. Save

Then go to the Switchboard manager and for the action use RunCode and type in the name of your function WITHOUT the () part:

so like: OpenMyXForm

close the switchboard manager and then run the switchboard.
 
Thank you boblarson, that worked like a charm. My second question is, how would I go about it if I wanted to do this with a few different forms? Would I have to rename the functions, or the modules?
 
I just renamed the Functions away from X to different letters, to have a unique form name for each module, which seemed to do the trick.
 

Users who are viewing this thread

Back
Top Bottom