switchboard question

G

Guest

Hi.
I've created a database, and have a question regarding the switchboard.
I've got a form that I want switchboard to open in datasheet view. I've
opened the form in design view and turned off all the views except datasheet
view and saved it, but the switchboard opens it in form view anyway.

How do I get the switchboard to open the form in datasheet view?

Thanks!
 
G

Guest

I'm thinking it'd have to be an adjustment in VB; on the DoCmd line. I can't
think of the command to have the default view of that form as a datasheet.
 
F

fredg

Hi.
I've created a database, and have a question regarding the switchboard.
I've got a form that I want switchboard to open in datasheet view. I've
opened the form in design view and turned off all the views except datasheet
view and saved it, but the switchboard opens it in form view anyway.

How do I get the switchboard to open the form in datasheet view?

Thanks!

Regardless of the form's default view, to open a form in datasheet
view from a VBA event you must explicitly tell Access to open it in
datasheet view.
If this is a command button on a form, use:
DoCmd.OpenForm "FormName", acFormDS

If this button is on the Switchboard created by the built in
Switchboard Manager, you'll need to make a change in the form's
coding. If you do so, you'll be unable to edit the additional change
using the manager. A better solution would be to simply create a new
module:

Public Sub OpenAForm()
DoCmd.OpenForm "FormName", acFormDS
End Sub

Then add a command to the switchboard using the manager:
Run Code
OpenAForm
 
G

Guest

Fred,

Thanks for helping out. I did this:
create a new
module:

Public Sub OpenAForm()
DoCmd.OpenForm "FormName", acFormDS
End Sub

Then add a command to the switchboard using the manager:
Run Code
OpenAForm


And it worked until I did it again for another form on the swithboard. Then
it knocked both out. I'm getting an error message: "There was an error
executing command".

Right now, I have 2 modules and the main code. The 2 different modules are
named differently, each with it's own form.

How do I clear it up so the buttons will respond appropriately?

Thanks.
 
F

fredg

Fred,

Thanks for helping out. I did this:
create a new
module:

Public Sub OpenAForm()
DoCmd.OpenForm "FormName", acFormDS
End Sub

Then add a command to the switchboard using the manager:
Run Code
OpenAForm

And it worked until I did it again for another form on the swithboard. Then
it knocked both out. I'm getting an error message: "There was an error
executing command".

Right now, I have 2 modules and the main code. The 2 different modules are
named differently, each with it's own form.

How do I clear it up so the buttons will respond appropriately?

Thanks.

Did you change the sub procedure name when you created the second
code?
OpenAForm()
DoCmd.OpenForm "Form1", acFormDS
End Sub

OpenAForm2()
DoCmd.OpenForm "Form2", acFormDS
End Sub

and change the switchboard command to OpenAForm2

I don't use this type of switchboard. Why not change to using your own
form and command buttons? You would have been done already.

For more information regarding the Access Switchboard look here:
http://home.bendbroadband.com/conradsystems/accessjunkie/switchboardfaq.html
 
G

Guest

"I don't use this type of switchboard. Why not change to using your own
form and command buttons? You would have been done already"

You're right, I would have.

I thought it'd be an easy thing to do, got everything done, and then decided
that the datasheet view would be more appropriate for the users in the group.
Architectural changes...gotta love them.

Thanks Fred, that did the trick.

bluezcruizer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top