Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access VB CreateControl problems

Status
Not open for further replies.

bujin

MIS
Oct 2, 2000
144
GB
I've now got a slight problem with the CreateControl function in Access VB. I am writing a simple form designer to make it easy to add questionnaire forms to the database, using the CreateControl method to add checkboxes and textboxes to the form. I would like to be able to add Tab Page controls so that different sections of the paper-based surveys can be represented on one form. I know how to create tab page controls:

Set tbc = CreateControl(frm.Name, acTabCtl, , , , 0, 0, 6000, 5000)

Now I need to know if it is possible (and if so, how) to add controls (i.e. the checkboxes, etc..) to the individual pages on the tab control.

Any assistance would be appreciated.

Thanks
Gareth
 
Yes it is... Here's how to do it using the Controls collection in Visual BASIC. Here's an example from the Help file:

Code:
Private Sub Form_Load()
   Form1.Controls.Add "VB.CommandButton", "cmdObj1", Frame1   
   With Form1!cmdObj1
      .Visible = True
      .Width = 2000
      .Caption = "Dynamic Button"
   End With
End Sub

This code adds a command button to a frame called Frame1. Open the Visual BASIC Help file and search for "Controls Collection" Then select Add Method (Controls Collection) Snaggs
tribesaddict@swbell.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top