Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Changing label caption in Frame?
Old
  (#1)
Pavan Arise
Guest
 
Posts: n/a
Default Changing label caption in Frame? - 06-04-2007, 09:44 AM

Hi all..
This may seem simple..but I am stuck here! I have a frame in which
I have a label. I was trying to change the caption of that label via
code (I mean at runtime & not design time). But there is always an
error saying "Compile error: Method or data member not found" I have
no idea how to solve thsi problem. I have created my label on the
frame itself. I tried to do it witha text box instead of a label...but
in vain...the same error occurs. Though it may be very simple, I am
not able to crack it. Can someone please help me out.I am stuck!!!
Thanks in advance for any suggetsions or help.

Regards,
Pavan
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Changing label caption in Frame?
Old
  (#2)
Rick Rothstein
Guest
 
Posts: n/a
Default Re: Changing label caption in Frame? - 06-04-2007, 09:44 AM

> This may seem simple..but I am stuck here! I have a frame in which
> I have a label. I was trying to change the caption of that label via
> code (I mean at runtime & not design time). But there is always an
> error saying "Compile error: Method or data member not found" I have
> no idea how to solve thsi problem. I have created my label on the
> frame itself. I tried to do it witha text box instead of a label...but
> in vain...the same error occurs. Though it may be very simple, I am
> not able to crack it. Can someone please help me out.I am stuck!!!
> Thanks in advance for any suggetsions or help.


You didn't supply any code to show what you were trying, so it is hard
to know exactly what you are doing wrong. I'll try a guess though... to
change the caption of a Label, you use its Caption property (Labels
don't have a Text property). ***uming your Label is named Label1, change
its caption like this...

Label1.Caption = "New Label Caption Here"

Rick - MVP

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Changing label caption in Frame?
Old
  (#3)
David
Guest
 
Posts: n/a
Default Re: Changing label caption in Frame? - 06-04-2007, 09:44 AM

EMAIL REMOVED (Pavan Arise) wrote in message news:<EMAIL REMOVED. com>...
> Hi all..
> This may seem simple..but I am stuck here! I have a frame in which
> I have a label. I was trying to change the caption of that label via
> code (I mean at runtime & not design time). But there is always an
> error saying "Compile error: Method or data member not found" I have
> no idea how to solve thsi problem. I have created my label on the
> frame itself. I tried to do it witha text box instead of a label...but
> in vain...the same error occurs. Though it may be very simple, I am
> not able to crack it. Can someone please help me out.I am stuck!!!
> Thanks in advance for any suggetsions or help.
>
> Regards,
> Pavan


It sounds like you are trying to pull the text that you want to ***ign
to the label or text box from a recordset. If this is the case, you
probably have the fieldname spelled wrong or have not opened the
recordset yet. To debug this and see what I mean (if I am right about
you trying to pull from a recordset), change your label ***ignment to
a declared string variable (Dim strTest as string). If you get the
same error, then it where you are trying to pull data from. If you are
pulling from a recordset, make sure:
1) You have properly declared the recordset and connection (if you are
using a connection to a data source)
2) You have properly opened both the recordset and, if appropriate,
the connection.
3) You have spelled the column name correctly and used the proper
syntax(rs!LastName and rs(0) are valid while rs.LastName is not)

If you are not pulling from a recordset, then ignore all of the above
and make sure you have your control name spelled correctly. :-)

David
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Changing label caption in Frame?
Old
  (#4)
Pavan
Guest
 
Posts: n/a
Default Re: Changing label caption in Frame? - 06-04-2007, 09:44 AM

EMAIL REMOVED (David) wrote in message news:<EMAIL REMOVED. com>...
> EMAIL REMOVED (Pavan Arise) wrote in message news:<EMAIL REMOVED. com>...
> > Hi all..
> > This may seem simple..but I am stuck here! I have a frame in which
> > I have a label. I was trying to change the caption of that label via
> > code (I mean at runtime & not design time). But there is always an
> > error saying "Compile error: Method or data member not found" I have
> > no idea how to solve thsi problem. I have created my label on the
> > frame itself. I tried to do it witha text box instead of a label...but
> > in vain...the same error occurs. Though it may be very simple, I am
> > not able to crack it. Can someone please help me out.I am stuck!!!
> > Thanks in advance for any suggetsions or help.
> >
> > Regards,
> > Pavan

>
> It sounds like you are trying to pull the text that you want to ***ign
> to the label or text box from a recordset. If this is the case, you
> probably have the fieldname spelled wrong or have not opened the
> recordset yet. To debug this and see what I mean (if I am right about
> you trying to pull from a recordset), change your label ***ignment to
> a declared string variable (Dim strTest as string). If you get the
> same error, then it where you are trying to pull data from. If you are
> pulling from a recordset, make sure:
> 1) You have properly declared the recordset and connection (if you are
> using a connection to a data source)
> 2) You have properly opened both the recordset and, if appropriate,
> the connection.
> 3) You have spelled the column name correctly and used the proper
> syntax(rs!LastName and rs(0) are valid while rs.LastName is not)
>
> If you are not pulling from a recordset, then ignore all of the above
> and make sure you have your control name spelled correctly. :-)
>
> David


Thanks David & Rick for your help. I got it figured out. I was using
Frame1.label.caption to modify the label. Anyway, I got a text box
instead & got it to run smooth. Thanks again for your help.

Regards,
Pavan
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top