Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2007

Tip: Looking for answers? Try searching our database.

create contro on tab control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rocco - 28 Mar 2007 00:58 GMT
Is it possible to programmatically create a control on one of the pages of a
tab control in a form?

Thanks,
Rocco
Sergey Poberezovskiy - 28 Mar 2007 02:52 GMT
Rocco,

It should not be a problem. The following code I have in VB.Net - but it is
really pretty similar in Access  - please let me know if you have problems:

Dim control As Access._Control  ' should be just Control in Access
If createInForm Then
  ' In Access you will need to use Set in the following line, app - is a
reference to Access.Application object, sectionIndex - is the index of form
section the control is created in:
 ' parentName should be the name of your tab control
  control = app.CreateControl(formName, controlType, sectionIndex,
parentName)
Else 'If createInReport
  control = app.CreateReportControl(reportName, controlType, sectionIndex,
parentName)
End If
control.Name = controlName
' then set the rest of the controls properties

HTH

> Is it possible to programmatically create a control on one of the pages of a
> tab control in a form?
>
> Thanks,
> Rocco
Marshall Barton - 28 Mar 2007 19:55 GMT
>Is it possible to programmatically create a control on one of the pages of a
>tab control in a form?

Creating controls is strictly a design time operation.  You
should not try to do this at run time.

The standard approach is to precreate the control and make
it visible/invisible as needed.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.