view all command buttons in a project via a combo box
hi all
i would be greatefull of anyone can help me out basically i want to create a vb front end linked to access database and create a menu in the vb front end of products listed in the database, currently i am using all access database with tab contol to section out the menu ie meat, chicken etc and within each tab i have created buttons for the products this good and works fine only prob is that if another product needs to be added then u have to go into design view create the command button and code it ie
[Form_OrderDetails subform].Item = Form_Orders.Command4.Caption
[Form_OrderDetails subform].Amount = 2.8
newrec
etc
i am looking to make a front end vb app and am thinking of having a form whereby i ave already allocated a load of command buttons on each tab but are hidden then with s sepearte form al have a text box1, txtbox 2 a combo box and a command button then i would like to click on the command button (AT run time) and the button would select the comand button from the combo box the buttons caption would become what ever i type in text 1 and etc
ps. am sorry if it sounds confusing. lol
i would be greatfull if anyone can help or if any ideas on creating a better menu form using sstab in vb. by the way i will be suing a touchscreen thats the reason for command buttons as products
thank you
Re: view all command buttons in a project via a combo box
hi thanx gavio for the reply
tried your code and wow yep it does work only prob is my sstab will be on form1 how will the user knw where which sstab caption the invisible button is on also from the edit form2 what code would i be able to update the hidden button.
also in your opinion do u think this would be the best way do make a menu system or do u know of anybetter way of doing this i could have used a combo box and display all my products from the access database into the combo box but you could imagine it would be difficult searching through 2 -300 houndered products heres a screen shot example
[ /IMG]
Re: view all command buttons in a project via a combo box
as this is for a touch screen, maybe create an array of commandbuttons then you can load those from the database as required
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: view all command buttons in a project via a combo box
hi
thanx westconn1 for the reply your answer sounds interesting and may be what i am looking for only thing is i dnt know really how to go about doing this do you have similar examples i could maybe have a look at, also say the array of command buttons will be based on products would it also be possible to add or delete certain products/command buttons from the vb front end during run time as i wish to create an exe for the front end??