I have code to create an access form , and the controls will be added dynamically , taking information about type of form control, answers , questions, answer type control , number of answer type control.
How to put the Question label ,Answer values and answer controls in the form by calculating the x-axis and y-axis values ?
I am adding certain number for every loop counter , to increment teh x- axis and y-axis variable value for inserting teh control but they seem to overlap each other ?
How do i calculate?Is there an easier way to doing this ?
1 1888
The following Code should help you. It will create 10 Text Boxes, along with their associated Labels, and align them Vertically with space in between: - DoCmd.OpenForm "frmCreateControls", acDesign, , , , acWindowNormal
-
-
Dim ctlText As Control
-
Dim ctlLabel As Control
-
Dim intDataX As Integer
-
Dim intDataY As Integer
-
Dim intLabelX As Integer
-
Dim intLabelY As Integer
-
Dim intCtlCtr As Integer
-
Dim intHeight As Integer
-
Dim intWidth As Integer
-
-
intLabelX = 1000
-
intLabelY = 300
-
intDataX = 3000
-
intDataY = 300
-
intHeight = 400
-
intWidth = 1900
-
-
For intCtlCtr = 1 To 10
-
'Create unbound default-size text box in detail section.
-
Set ctlText = CreateControl("frmCreateControls", acTextBox, , "", "", _
-
intDataX, (intDataY * intCtlCtr) + (intCtlCtr * intHeight), , intHeight)
-
-
'Create child label control for text box.
-
Set ctlLabel = CreateControl("frmCreateControls", acLabel, , ctlText.Name, "", _
-
intLabelX, (intLabelY * intCtlCtr) + (intCtlCtr * intHeight), intWidth, intHeight)
-
ctlLabel.BorderStyle = 1 'Solid
-
Next
-
-
DoCmd.Close acForm, "frmCreateControls", acSaveYes
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Will |
last post by:
Hi all.
I'm learning VB.Net and am developing a WinForms app.
I'm trying to make an app that I will use to scan in one or more than
on image. I want to use a tabbed interface to hold each image....
|
by: wASP |
last post by:
Hello again to all of you geniuses,
I'm having a problem trying to load dynamic controls at the initialization phase.
I've read the docs, and I thought I had it figured out:...
|
by: Tyler Carver |
last post by:
I am trying to use some dynamic controls that are built and then added
to tables. The problem that I am having is the timing of when I can
populate the controls and have the state remain after a...
|
by: Leo J. Hart IV |
last post by:
OK, here's another question for the experts:
I am building a multi-step (3 steps actually) form using a panel for
each step and hiding/displaying the appropriate panel/panels depending
on which...
|
by: Paul W |
last post by:
i have some dynamic controls that i add to a webform (actually, i dynamiclly
build a table and add the controls to cells). some of these controls are
HtmlSelect controls with the multiple property...
|
by: WebBuilder451 |
last post by:
I have a series of dynamic link buttons created based upon a datareader. I've
added a click event and it calls the sub ok:
example: "while loop through the reader"
Dim ltrCtrl As New...
|
by: Tarscher |
last post by:
hi all,
I have this seemingly simple problem. I have lost a lot of time on it
though.
When a user selects a value from a dropdownlist (static control) a
dynamic control is generated. I have...
|
by: Andreas Wöckl |
last post by:
Hi Group!
I have a web form that is created dynamically - so I create Textboxes,
RadioButtonLists, CheckBoxLists and so on - I have found some articles that
there may be some problems with...
|
by: Scott Roberts |
last post by:
I always thought that the viewstate "keys" included the control ID. As long
as the control IDs were unique, there shouldn't be any conflicts. Well, it
appears that that may not be the case with...
|
by: tommymo |
last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| | |