[AccessD] A2000:Make Visible based on the looped integer returned

paul.hartland at fsmail.net paul.hartland at fsmail.net
Mon Jun 5 09:38:22 CDT 2006


Not too sure if you have done a typo, but there is a full stop at the end of this line....

strControlName = "txtProfile" &  intX.


Paul



Message Received: Jun 05 2006, 03:23 PM
From: "Darren DICK" 
To: "'Access Developers discussion and problem solving'" 
Cc: 
Subject: [AccessD] A2000:Make Visible based on the looped integer returned

Hi All

Can't quite get the syntax right on this one

I am looping through an SQL statement

The Statement produces sequential numbers (as integers) 1,2,3,4,5 etc

e.g...

rs!ProfileID will = 1 on the first loop
rs!ProfileID will = 2 on the second loop etc etc until EoF

So far so good...

Based on those numbers I wanna loop thought the recordset the number of times
the dot recordcount allows 

and I want to make controls on the form - that end with the looped Recordset
integer - visible or not

Code above and below my air code works fine - all the declarations are OK

Air Code.....

dim strControlName as string

For intX = 1 To rs.RecordCount
strControlName = "txtProfile" & intX.
Me(strControlName).Visible = True
Next intX

Anyone know what the correct syntax for the air code is??

Many thanks

Darren

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list