outomatically fill in fields based on the selection in the switchb

W

Waynef

How can I set up a field in a data base to automatically be filled in based
upon the users selection in the switch board.Example if the user selects
project 1 in the switchboard when he goes to the form the project name field
will automatically indicate project1
 
M

Mike

In such situation I would make several copies of the form (one for each
project), like "frmForProject1", "frmForProject2", etc.
On form "frmForProject1" make the default value for the field "project1", on
form "frmForProject1" make the default value for the field "project2" and so
on.
In this case you can even make the field locked or invisible, so that users
could not change the value.
In the switchboard assign buttons to open different forms accordingly.
Mike
 
V

Vincent Johns

Waynef said:
How can I set up a field in a data base to automatically be filled in based
upon the users selection in the switch board.Example if the user selects
project 1 in the switchboard when he goes to the form the project name field
will automatically indicate project1


Here's one way. On the Switchboard, I set up a button called "Project
1" defined thus:

Text: Project 1
Command: Run Macro
Macro: M_SetProj1

and Macro [M_SetProj] contains the following actions:

OpenForm F_SetValue
SetValue [Forms]![F_SetValue]![Value], "Project 1"

and text box [Value] on Form [F_SetValue] is unbound. You can set an
event on that text box to do something interesting, but at this point
the value is available for you to use.

-- Vincent Johns <[email protected]>
Please feel free to quote anything I say here.
 
Top