473,467 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Looping lables?

59 New Member
hello everyone !
I'm trying to make something like a calendar
I made some lables with the same names, with another number at the end of each one. eg: d1, d2, d3, d4
now I want to loop through them all

thats whats I'm trying..

x = 1
Do While x < 5
d [" & x & "].Caption = DateAdd("d", x, Date)
x = x + 1
Loop


what am I doing wrong ?
Aug 30 '07 #1
1 1319
FishVal
2,653 Recognized Expert Specialist
hello everyone !
I'm trying to make something like a calendar
I made some lables with the same names, with another number at the end of each one. eg: d1, d2, d3, d4
now I want to loop through them all

thats whats I'm trying..

x = 1
Do While x < 5
d [" & x & "].Caption = DateAdd("d", x, Date)
x = x + 1
Loop


what am I doing wrong ?
Hi, zivon.

The wrong thing you are doing is that you are expecting VBA to execute code before compiling. ;)

Try to refer to label in the following manner.
Expand|Select|Wrap|Line Numbers
  1. Me.Controls("[d" & x & "]"].Caption = DateAdd("d", x, Date)
  2.  
Good luck.
Aug 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
5
by: masood.iqbal | last post by:
My simplistic mind tells me that having local variables within looping constructs is a bad idea. The reason is that these variables are created during the beginning of an iteration and deleted at...
1
by: nehal | last post by:
Sir, i want in my application, a form should display lables according to the data in the database means no. of lables are not decided. how can i do this ? i also want my first form should...
1
by: Jerry | last post by:
Hi again, I have two forms as controls. Both are on a main form and with a treeview I switch back and forth between the two. On the first form is a calculation. The result of this calculation...
4
by: =?Utf-8?B?T2xhbg==?= | last post by:
Hi, I'm trying to dynamically remove labels from a windows form in csharp. I have a foreach loop similar to : foreach(Control c in this.Controls) { c.Dispose(); }
20
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1...
4
by: donal | last post by:
I'm using MS Access; Is there an easy way to add a "0" in front of my zip codes? I am printing address lables and the "0" is not showing up? Help!
1
by: namartajhamb | last post by:
I have one Confirm Message Box using Confirm() javascript function which display two buttons Ok and Cancel. I want to Change these buttons lables into YES/NO. how can i change lables of buttons....
0
by: Shalini Bhalla | last post by:
i want to generate lables on which records are coming from diff tables , in form of master -- detail relation ship , can you suggest me a good lable printing software which can help me in this...
0
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.