PDA

Click to See Complete Forum and Search --> : SubForm


Lloyd
Feb 22nd, 2000, 04:24 AM
Hi Guys and Gals!!

Simple question, Does VB5 or VB6 have anything like the Access SubForm control and if it does what is the name or location of it?

Thanks!!

Lloyd Braden

Forest Dragon
Feb 24th, 2000, 10:42 PM
The ActiveX control that can be used like a subform is the DataRepeater control that comes with VB6. I think its full name (the name that appears in the components list) is "Microsoft Data Repeater Control 6.0".

This control is used to show multiple records at the same time, just like a subform. I will give you general steps how to do it:

1. Create an ActiveX control with all the controls (mostly TextBoxes) that you want in the subform. Make them look just like an Access subform.

2. Now you need to add a property for every field you want and map them to the appropriate control's property.

For example: Suppose you want a subform with the field: CustomerNum, CustomerName. You need to add 2 TextBoxes to the ActiveX control, create 2 properties: CustomerNum and CustomerName and then map them to the TextBoxes' Text property.

3. Make an OCX file from your ActiveX and then start a new project.

4. Place the DataRepeater control on the form and set its RepeaterControlName property to the new ActiveX control you have just made.

5. Bind the DataRepeater to a datasource.

6. Open the property pages of the DataRepeater and go to the RepeaterBindings tab. There you can select the properties of your ActiveX control and bind them to the appropriate data fields.

Hope you understood this explanation. I tried to make it clear enough.

Good Luck!!!