May 1st, 2007, 11:01 PM
#1
Thread Starter
New Member
[RESOLVED] Format() function not working at all
I've recently returned to VB6 and am having an issue with the Format() function. I wrote a program years ago and it worked correctly then. When I try to run it now it gives me that compile error "can't find library" at all the Format functions.
An example of how I'm using it is like so:
string = "C: " + Format(getHDUsed, "###,.00") + " GB"
I'm thinking that I'm missing some kind of add-in or library but I don't know which is associated with the Format function. Nor do I even remember how to install add-ins or libraries. If anyone could help me with this, it would be much appreciated.
Last edited by FanGuy; May 2nd, 2007 at 12:57 AM .
May 1st, 2007, 11:13 PM
#2
Fanatic Member
Re: Format() function not working at all
Change + to &
And if still problems, try a simpler Format instruction and see how that goes
May 1st, 2007, 11:19 PM
#3
Thread Starter
New Member
Re: Format() function not working at all
Originally Posted by
RobCrombie
Change + to &
And if still problems, try a simpler Format instruction and see how that goes
Thanks for responding.
Ive already tried + to & that doesn't seem to be the issue.
Format() is used thoughout the program and it seems like it doesn't want to work anywhere. Some examples are more simple than others.
May 1st, 2007, 11:23 PM
#4
Fanatic Member
Re: Format() function not working at all
vb Code:
Private Sub Form_Click()
Me.Print Format(Date, "yyyy mmm d")
End Sub
Does that work on your pc (it works on mine)
May 1st, 2007, 11:29 PM
#5
Fanatic Member
Re: Format() function not working at all
Are your Project References like this (ignore the highlighting)
Attached Images
May 1st, 2007, 11:31 PM
#6
Re: Format() function not working at all
Did you put any reference? Check for MISSING OCX / LIBRARY in the reference and uncheck it. It may be deleted from the windows system32 folder.
May 1st, 2007, 11:43 PM
#7
Thread Starter
New Member
Re: Format() function not working at all
It looks like this: (These are the ones checked off)
Visual Basic For Applications
Visual Basic runtime object and procedures
Visual Basic objects and procedures
OLE Automation
Messenger API Type Library
Windows Media Player
Windows Media Player
Windows Media Player
Messenger Type Library
Messenger Private Type Library
MISSING: Messenger Addins Type Library
And the the rest that are not checked
Last edited by FanGuy; May 1st, 2007 at 11:49 PM .
Reason: Could not post image
May 1st, 2007, 11:49 PM
#8
Fanatic Member
Re: Format() function not working at all
If you are having trouble attaching the image, you can send it to me -
robhp AT iprimus DOT com
May 1st, 2007, 11:58 PM
#9
Fanatic Member
Re: Format() function not working at all
In the meantime.
All the ticks in my image are normally there in every VB6 project.
So go ahead and ensure they are ticked in your project.
Whilst you are solving this, you should be doing it in a tiny stand alone example.
Once you get that working, then go back to your larger project.
May 2nd, 2007, 12:00 AM
#10
Thread Starter
New Member
Re: Format() function not working at all
Originally Posted by
RobCrombie
In the meantime.
All the ticks in my image are normally there in every VB6 project.
So go ahead and ensure they are ticked in your project.
Whilst you are solving this, you should be doing it in a tiny stand alone example.
Once you get that working, then go back to your larger project.
will do thanks for all your help. This is something that I'm scratching my head over.
May 2nd, 2007, 12:04 AM
#11
Fanatic Member
Re: Format() function not working at all
Attached Files
May 2nd, 2007, 12:13 AM
#12
Thread Starter
New Member
Re: Format() function not working at all
Originally Posted by
RobCrombie
vb Code:
Private Sub Form_Click()
Me.Print Format(Date, "yyyy mmm d")
End Sub
Does that work on your pc (it works on mine)
Sorry I didn't respond to this right away. This works when I open a new project. Even this works:
Code:
Private Sub Form_Click()
Me.Print Format("123456789", "###,.00")
End Sub
But when I add it to my already existing project, it doesn't work. It gives me the same error.
May 2nd, 2007, 12:17 AM
#13
Fanatic Member
Re: Format() function not working at all
We have not seen an image of your References dialog
(VB can get huffy when there is a different problem elsewhere)
Last edited by RobCrombie; May 2nd, 2007 at 12:20 AM .
Rob C
May 2nd, 2007, 12:20 AM
#14
Thread Starter
New Member
Re: Format() function not working at all
May 2nd, 2007, 12:23 AM
#15
Fanatic Member
Re: Format() function not working at all
Yup, probably that missing reference is confusing VB
Attached Images
Last edited by RobCrombie; May 2nd, 2007 at 12:33 AM .
Rob C
May 2nd, 2007, 12:28 AM
#16
Re: Format() function not working at all
Originally Posted by
FanGuy
MISSING: Messenger Addins Type Library
this the thing that causes the problem...if you know that you are using the functions from this library then browse it, else just remove this and you should get other errors, but it will not stop on the format function.
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
May 2nd, 2007, 12:29 AM
#17
Thread Starter
New Member
Re: Format() function not working at all
That was it!!!! I just unchecked the MISSING. It work perfectly now just like I remember.
Thanks so much.
Now how do I mark this as RESOLVED?
May 2nd, 2007, 12:55 AM
#18
Re: Format() function not working at all
Originally Posted by
FanGuy
That was it!!!! I just unchecked the MISSING. It work perfectly now just like I remember.
Thanks so much.
Now how do I mark this as RESOLVED?
You did missed reading post #6 right?
May 2nd, 2007, 12:57 AM
#19
Thread Starter
New Member
Re: Format() function not working at all
Originally Posted by
zynder
You did missed reading post #6 right?
Yes, I gues I did.
May 2nd, 2007, 01:00 AM
#20
Re: [RESOLVED] Format() function not working at all
Click the thread tools and Mark thread resolved.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width