-
I am facing problem in designing a detail line entry form, I want to enable user to add as many line items he wants , but at the same time I want to show him at least 10 line items on the opening screen. I have tried using control arrays but in that too,
I have to add the controls to the array at design time , but I don't know how many Line items the user will require, I have tried datarepeater control also but in that too I need to set data source & data member property at design time but I want to set it at runtime because my line item is not containing fields directly from any one table
it is containing fields from two tables & that too not the fields itself i.e instead of account code I am displaying & asking for account name. So , in short I am really stuck at this point & I don't Know waht to do to get my form designed but the properties set at runtime.
Please Please Please help me.
-
You can add control array elements at runtime: Suppose you have one control named text2 with property index set to 0 on your form. Use the following code to add additional elements at runtime right under your existing control:
Code:
Sub AddText2Control()
Static ControlCount As Long
ControlCount = ControlCount + 1
Load Text2(ControlCount)
Text2(ControlCount).Top = Text2(ControlCount - 1).Top + Text2(ControlCount).Height
Text2(ControlCount).Left = Text2(ControlCount - 1).Left
Text2(ControlCount).Visible = True
End Sub
I hope that helps!
Roger
-
Why not set up a function that returns a RecordSet object with the SQL statement that generates the Line Item Data?
Then bind that to a datagrid control?