View Single Post
  #2  
Old February 5th, 2010, 04:15 PM posted to microsoft.public.access.gettingstarted
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Button Caption help

Why not just use a combo box or list box? Instead of the command button
Click code you could run the code in the combo box After Update event.

What you describe can probably be done, but the details are unclear. What do
you mean about changing an employee name in the employee table? Would you
replace one name with another?

For an Employee table you would do well to have something like this:

tblEmployee
EmployeeID (primary key, or PK)
FirstName
LastName
etc.

EmployeeID would probably be a Number field (table design view), or maybe
autonumber, but in any case an unchanging value. If the Employee last name
changes some day you can just change the LastName value. All instances of
storing the Employee information involve storing the number only, so old
records will reflect the new name. It's sort of like SSN at the IRS, which
is the same no matter your name, where you live, etc.

In general you will need a way to share EmployeeID between the command button
and the label, maybe by inserting EmployeeID into the Tag property of the
command button, but if you're going to do that you may as well just change
the Employee name in the label caption. Again, I expect it can be done, but
it could well be more work than it's worth to you.





Jim Brooks wrote:
Hi to all I require help for what maybe a simple problem. I have a form
frmPettyCash and on the form are 3 buttons Cmd1, Cmd2 and Cmd3 which open the
spending reports for 3 employees. There is a table tblEmployees with fields
EmployeeID and EmployeeName with the 3 employee names. What I would like to
do is link the EmployeeNames to the button caption ie Employee 1 to
Cmd1.Caption, Employee2 to Cmd2.Caption etc. so that in the future if I
change an employee name in the employee table the caption on the
corresponding button will change also. Any help greatly appreciated.
Thanks in advance
Jim Brooks


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/201002/1