Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine which command button is clicked?

Status
Not open for further replies.

Doraemon

IS-IT--Management
Sep 12, 2003
31
HK
I have 3 textboxs with a command button besides each of them on a "add_order_f" form in which when clicked will open the form "search_user_f". After the user has chosen a particular record in the "Search_user_f", the user_code of that record will be extracted into the "add_order_form".

My question is:
How can I check for which button among the 3 buttons, the user has clicked after the "add_order_form" is open? So that I can write the user_code chosen in the "search_user_f" to the corresponding textbox.

Thx for your kind assistance.
 
Probably the easiest way is to incorporate the three buttons as part of an Option Group. That way whenever a single button is clicked the Option Group will retain the value or number associated with the particular button that was clicked.

Alternatively create a hidden field on the add_order_f form and place code in the Click Event for each button that places a unique value in the field. So long as the form remains open the value will be retained.

If you want the value to be retained even if the add_order_f form is closed then store the value in a table or simpler still create a Global variable in a standard code module and get the code in each button's click event to update the global variable, which will remain accessible throughout the database.
 
tunsarod, thanks for your help.

I have tried to use a hidden field for the application as u have suggested. It can performed what I want now, really haven't thought of that before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top