Hey guys,
I'm a relative beginner to VB having spent the last few years learning PHP and MySQL.
I'm currently building a system to manage our quotations, purchase orders and sales orders. For each of the three systems there's a main form and a sub form, for example, tbl_quotations links to tbl_quotation_details - you have one quotation with many items. The exact same structure applies to purchase orders and sales orders.
I've built a form which contains many search parameters and is used to filter quotations in the associated sub form. I'm now trying to build a function to convert a quotation and its many items into a purchase order or a sales order, with the exact same number of items. This would be straight forward if they only ever contained one item.
In PHP I would run a select query to grab all of my records, save them to an array and then loop through the array running an INSERT query on each row.
I figured the same way would make sense in VB but read somewhere that creating an array to do this isn't necessary. So first of all can anyone confirm that? What is the corect way to do this? Using an array? Or can I simply run a SELECT query and then an additional INSERT within it?
If I do need to use an array, what's the best way of setting up a 2 dimensional one that contains all of the fields from my query?
I'm a relative beginner to VB having spent the last few years learning PHP and MySQL.
I'm currently building a system to manage our quotations, purchase orders and sales orders. For each of the three systems there's a main form and a sub form, for example, tbl_quotations links to tbl_quotation_details - you have one quotation with many items. The exact same structure applies to purchase orders and sales orders.
I've built a form which contains many search parameters and is used to filter quotations in the associated sub form. I'm now trying to build a function to convert a quotation and its many items into a purchase order or a sales order, with the exact same number of items. This would be straight forward if they only ever contained one item.
In PHP I would run a select query to grab all of my records, save them to an array and then loop through the array running an INSERT query on each row.
I figured the same way would make sense in VB but read somewhere that creating an array to do this isn't necessary. So first of all can anyone confirm that? What is the corect way to do this? Using an array? Or can I simply run a SELECT query and then an additional INSERT within it?
If I do need to use an array, what's the best way of setting up a 2 dimensional one that contains all of the fields from my query?