PDA

View Full Version : Code update with the help of form



kakaruzas
08-27-2009, 04:53 AM
Hello everybody!
I have ran into with one problem trying to build on my little program. As it will need to be updated monthly (and I won't have such opportunity) I would need to update it just by filling in the form. So, the problem is - I just don't know how to do it. The form needs to update the code. I am even not sure if it is possible. The form has to insert parts of code (including Case and opening a workbook).
So, please, if anyone has an idea, help me. :help I have attached a simplified workbook just to show you the case. Any help or advice will be much appreciated!
Big thanks in advance!

Bob Phillips
08-27-2009, 05:39 AM
More detail, lots more detail required as to what you want to do, requirements not goals.

kakaruzas
08-27-2009, 06:54 AM
Ok. I'll try to explain as best as I could. I need the data entered to the form to be transfered to the code. This way, both - the comboboxes would be filled and the code updated. If I enter the the region/country, it should go to Workbook_Open code:
Private Sub Workbook_Open()
Tabelle1.cmbRegion.Clear
Tabelle1.cmbCompany.Clear
Tabelle1.cmbEmployee.Clear
Tabelle1.cmbRegion.Text = ""
Tabelle1.cmbCompany.Text = ""
Tabelle1.cmbEmployee.Text = ""
Tabelle1.cmbRegion.AddItem "Germany"
Tabelle1.cmbRegion.AddItem "France"
'new regions should be added by the help of the form here in format like:
'Tabelle1.cmbRegion.Additem "The country/region entered"

End Sub


Next, you have to enter the company. this gets even more complicated as a code like this should be added to Sheet1 code:
ElseIf cmbRegion.Value = "Country/region name" Then
cmbCompany.Clear
cmbEmployee.Clear
cmbCompany.AddItem "Company name"

It gets so nasty, because if the company is allready existing in the code, only cmbCompany.AddItem "Company name" should be added to apropiate place.
Next, employee name will be needed and it looks very alike to company formula. It is in the same Sheet1 code.

So, when this is done, the directories of the "CV" and "Order list" need to be added to form. From there, they should go to the module1. I have made more comments there so, please, if you can take a look.

I am still wondering if it would be possible to complete the task I have thought of. However, it is very interesting for me and I wish you could hellp me in any way :)

Regards

rbrhodes
08-28-2009, 01:04 AM
Hi kk,

This isn't a simple question it's a project (read job). I've looked at it and its big!

It's possible but...

kakaruzas
08-28-2009, 02:14 AM
Hey rbrhodes!
I was afraid of such answer... However, now I know that it is possible. :) Maybe you could tell some functions or anything that could help me? Because I didn't want that someone did the job for me. Just wanted some advice. :)
Thanks in advance!
Cheers

rbrhodes
08-28-2009, 02:18 AM
Hi.

Well I've been working on it and I'll send you something but you'll be debugging...

rbrhodes
08-28-2009, 05:38 PM
Hi Again,

Well I got carried away again...

kakaruzas
08-31-2009, 01:12 AM
Hey there!
Thank you for the code and all the work you have done! I'll check it as soon as I have time for VBa. And thanks again! :)

rbrhodes
08-31-2009, 01:19 AM
so far...so good.

<grin>