dbTalk Databases Forums  

Making lable visible on runtime.

comp.database.ms-access comp.database.ms-access


Discuss Making lable visible on runtime. in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SAP
 
Posts: n/a

Default Making lable visible on runtime. - 07-01-2003 , 11:43 AM






Hi

I am trying to write a code where there are 25 non visible lable on a form.
I want to make that lable visible if recordset has a value to write.

while (Not (rs.EOF))

me.lbl1.visible = true
me.lbl1.caption = rs![Pat]
rs.MoveNext
' if rs.movenext is ture then i want to show second lable and wirte a vlue
'in that lable
' me.lbl2.visible = true
'me.lbl2.caption = rs![Pat]

Wend

Can anyone hlp me please , Thank You !
SAP

Reply With Quote
  #2  
Old   
Scott McDaniel
 
Posts: n/a

Default Re: Making lable visible on runtime. - 07-01-2003 , 03:31 PM






I'm not a big fan of the While-Wend loop, so I rewrote this in a Do Loop:

Dim strName as string
Dim nCount as long

nCount = 1

Do Until rs.EOF
strName = "lbl" & CStr(nCount)
Me.Controls(strName).Visible = True
Me.Controls(strName).Caption = rs("Pat")
rs.MoveNext
nCount = nCount +1
Loop

I'm making the assumption that you have a properly opened recordset with the
appropriate fields, etc.


"SAP" <saparikh_98 (AT) yahoo (DOT) com> wrote

Quote:
Hi

I am trying to write a code where there are 25 non visible lable on a
form.
I want to make that lable visible if recordset has a value to write.

while (Not (rs.EOF))

me.lbl1.visible = true
me.lbl1.caption = rs![Pat]
rs.MoveNext
' if rs.movenext is ture then i want to show second lable and wirte a
vlue
'in that lable
' me.lbl2.visible = true
'me.lbl2.caption = rs![Pat]

Wend

Can anyone hlp me please , Thank You !
SAP



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.