switchboard automation

  • Thread starter Thread starter Nelson
  • Start date Start date
N

Nelson

Hello,

I would like to know how can I have the switchboard
update a field on a table once it is pressed! For
example, if in my switchboard I have the buttons as:

Garage
Living Room
Basement

Once I click on Garage, it will go to a switchboard page
called Garage where I can enter data in a table called
inventory (common to all). I also have a table called
Areas, where the names Garage, Living Room, etc are
listed. Now in this inventory table, I have a field
specifying the area which is a lookup to the table areas
and selecting the area I want...and what I want to do is
once I click on any one of buttons in the main
switchboard I would like the area field on the inventory
table to be automatically entered. This way, I don't
have to select the area once I'm in the specific
switchboard page.

Thank you in advance for any help.
 
Go to the VBA code for the button. You will probably see
the code:

Docmd.openform "formname",....

if the code does not have acDialog in it, then in the
next line of code write this if the selection control is
a combobox

form_FORMNAME.CONTROLNAME = 1 (or 2 or 3 depending on the
corresponding bound value for the names in your list
box. You can see what the bound values are by going to
design view on the form you are launching and click on
the properties of the combobox. On the data page find
the Table\Query line and open it up. You will see the
bound value(if this was set up by the wizard) in column
1. Have each button put the corresponding value into the
control. When the form is opened and loaded, the combo
box will now display the value that you seek.

ds
 
Back
Top