Switchboard to open blank form

G

Guest

Thanks in advance!

I have two specific questions, and a more general one at the bottom.

1would like to set up two buttons on my Switchboard:

1) Start a new Employee Profile
User clicks the button and is taken to the FIRST BLANK RECORD in the
database.
How do I set this up? Two button options from the Switchboard Manager
dropdown list are Open Form in Add Mode & Open Form in Edit Mode.
Neither does what I want.

2) Edit Existing Form
User searches for the employee name in combo box next to button and is
taken straight to the first tab of that record. I know how to set up a
combo box
and point it to the right source field. But how do I get the button to
"read" the
selection in the text box and open that record?

The more general question: OK, this is my first Access project, and I'm
using the Switchboard Manager - but does one HAVE to? It seems that I could
just design a form with the look of a switchboard, and not have all that
extra code for buttons I don't need, right?

Thanks ya'll!
 
R

Ron2006

1) The option to Open Form in Add Mode will do it IF the form you are
calling is a form that is directly bound to the employee profile table
(or query that is bound to the employee profile table.) The CALLED form
has to be set up properly for the Add mode to work.
This is true if you are using the switchboard manager.

2) In general this one cannot be done directly form the switchboard
manager. Develop your own form that has a combo box that then have
either the afterupdate event or a button call the same form that is
called in the above option but have the criteria for the form/query set
to only look at the selected employee.
If the combo box has two fields in its query Employee ID and Employee
name.
have the ID be the bound field but have a 0 length. This will cause the
employee name to show but the ID be the field that is kept and used for
the query in the called form.

I believe that most developers (but not all) tend to build their own
menu system rather than use the Access generic one.

Ron
 
J

jahoobob via AccessMonster.com

A little more on 2)
You could simply use the button to open your edit form upon which you have
placed a combo box for which you select the third option in the combo box
wizard or create you own menu form, upon which you place your combo for
lookup, to replace the switchboard form.
Loose the switchboard. As you have found, it is limited in what it can do
but not in what it can't do.
 
G

Guest

Hi Ron. Thanks for this reply. I have decided to create my own
"switchboard" - Thanks to code posted on this site, I have been successful in
creating a button that opens the next blank record.

I am trying to follow your directions about creating a search combo box and
then having the button open the record that matches the name selected in the
combo box. But I'm afraid, I'm too new at this to be able to do it on my
own. So far I have a combo box, and it's set to display the contact names -
working fine. I have a new button, that so far does not do anything. Let's
assume that my table is called "mytable" and the combobox is called
"mycombo", what do I do next to make the button "read" the combo selection
and go to that record?

Thanks so much.
 
R

Ron2006

1) The combo should probably display the contact name but the bound
field should be the key field for the table/query.

2) create the button and use the wizard and tell it to open the form
you want opened.

3) As it stands, that form would probably open with ALL records
available.

It will probably generate the following code for the on-click event.
==========================
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form2"

DoCmd.OpenForm stDocName, , , stLinkCriteria

===========================
You will want to modify the code to include the loading of the
stLinkCriteria variable.
===========================
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form2"

stLinkCriteria = "[ID]=" & Me![mycombo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
===========================

[ID] is the key field in the table/query that is the datasource for
the form
Form2 is the name of the form.

Ron
 

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