I am doing an assignment and I stack could not thinking about this matter:
On the VB6 form, I have to create fields that could be added and calculated automatically as follow:
The original form is, there is one row such as Text Fields: Item No, Description, Qty, Price/Item, Total
and two Button: "Add Tables" and "Calculate"
If I click "Add Tables", it will create another row below the first row, and so on.
After I finished created rows (for an example 7 rows), all amount in the text fields of "Qty" and "Total" will be calculated by clicking "Calculate" then the result will be appeared in another new text field "Total Purchase".
Anyone could help me to find this solution please?.....I really need your help...
Ok, create the all the textboxes you want, quantity etc..
Set all textboxes index to 0. Add a Combobutton and use this code:
VB Code:
Private Sub Command1_Click()
Load text1(Ubound+1)
text1(Ubound).Left = text1(Ubound-1).left
text1(Ubound).Top = text1(Ubound-1).Top + 300
text1.visible = true
End Sub
Now this code needs to be written for each textbox (ive called my textbox simply text1 in this example)
This will add 1 extra row of textboxes at the click of a button
Thank you for your kind helps...However what I mean is, everytime I "Add" rows, it will automatically add rows as well in a Word Document. For instance, everytime I fill Text Fields: Item No, Description, Qty, Price/Item, Total and clicked on "Add" button, it does not only add rows in VB (VBA) but it also would add rows as well including all text into a Word Document. Would you help me please?
Well, Im not particulary good in office programming...Perhaps you should try n ask in Office development ?
Or you could try using a database instead? Thats something I could help you with