What I have at the moment is a command button that has code in the On_Click procedure that adds a new record to a given table and populates it with values from text boxes on the form.
Because I am adding records to different tables through different forms then the same code structure is repeated many times...a classic case to use a function!
I thought the easiest way to do this was create an array into which you pass the form name, table name, textbox names (on the form) and field names (in the table)
The problem I have is, different tables have different numbers of fields, and therefore the forms have different numbers of text boxes. This means I can't declare an array with a fixed number of arguments.
How do I go about declaring an array with varying numbers of arguments (presumably defined at run-time?), or is there a different approach I should be trying?
Thanx greatly, in advance
Matt
Because I am adding records to different tables through different forms then the same code structure is repeated many times...a classic case to use a function!
I thought the easiest way to do this was create an array into which you pass the form name, table name, textbox names (on the form) and field names (in the table)
The problem I have is, different tables have different numbers of fields, and therefore the forms have different numbers of text boxes. This means I can't declare an array with a fixed number of arguments.
How do I go about declaring an array with varying numbers of arguments (presumably defined at run-time?), or is there a different approach I should be trying?
Thanx greatly, in advance
Matt