If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
enabling buttons...
Thanks for all good help you guys offer!
I have a listbox form that displays a list used for multiple reasons. I.E. it lists templates and you can select them to be modified, to view a summary, etc. This listbox is launched from other forms. Question: Is there a way to have multiple buttons on this list box but only enable certain ones depending on which form launched it? -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
enabling buttons...
Hi wabit,
I've never heard of having buttons on a list box, but you can certainly have buttons on a form. Yes, these could be enabled depending on which form launched it by using the optional OpenArgs parameter in the DoCmd.OpenForm statements in each calling form. You would then use code in the form that is opened, in the Form_Open event procedure, to inspect the value of the OpenArgs statement if not null. You can use a Select Case....End Select construct to conditionally enable/disable command buttons based on the OpenArgs value. Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ __________________________________________ "thewabit via AccessMonster.com" wrote: Thanks for all good help you guys offer! I have a listbox form that displays a list used for multiple reasons. I.E. it lists templates and you can select them to be modified, to view a summary, etc. This listbox is launched from other forms. Question: Is there a way to have multiple buttons on this list box but only enable certain ones depending on which form launched it? |
#3
|
|||
|
|||
enabling buttons...
Tom,
Thanks for the reply. I guess I should have stated that better. It is a form with a listbox on it and buttons at the bottom to open other forms and populate it with the data selected in the list box (or data the list box item represents). I have successfully used the openargs to do this however my delemma now is the 1st form has buttons (which now I am learning aren't buttons) that have been programmed to launch the 2nd form (the one with the listbox). Depending on the item clicked on the first form determines which button on the 2nd form will enable. So the point is... Question 1...Do I send the form name AND the selectable item name (button) in open args and how? Question 2...How do I determine what the name of that selectable item is because right now they are named "Label408, Label409, etc. I don't think those are buttons. Thanks! Tom Wickerath wrote: Hi wabit, I've never heard of having buttons on a list box, but you can certainly have buttons on a form. Yes, these could be enabled depending on which form launched it by using the optional OpenArgs parameter in the DoCmd.OpenForm statements in each calling form. You would then use code in the form that is opened, in the Form_Open event procedure, to inspect the value of the OpenArgs statement if not null. You can use a Select Case....End Select construct to conditionally enable/disable command buttons based on the OpenArgs value. Tom Wickerath Microsoft Access MVP http://www.accessmvp.com/TWickerath/ __________________________________________ Thanks for all good help you guys offer! [quoted text clipped - 3 lines] Question: Is there a way to have multiple buttons on this list box but only enable certain ones depending on which form launched it? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201001/1 |
Thread Tools | |
Display Modes | |
|
|