Type-Declaration character does not match declared data type Error Using Time$

Posted on 2003-10-27
Last Modified: 2013-12-03

I get Type-Declaration character does not match declared data type when the following line of code tries to execute:

Txt_Log.Text = Txt_Log.Text & Time$ & " - Com Port " & ComPort & " Opened."

I tried just copying this line to an empty program and it works fine... So what else could be causing the problem?

Question by:Dormouse31
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 9628829
All looks pretty standard... Maybe try CStr(Time) instead of Time$ though I don't see why that'd be a problem...

Expert Comment

ID: 9628888
Can you post the function the line is in?

Author Comment

ID: 9628898
Thanks for the help, but I just figured it out. I stupidly had a variable named Time...
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 16

Accepted Solution

Richie_Simonetti earned 50 total points
ID: 9628906
Time is a reserved word, are you using it as a variable name?

Author Comment

ID: 9629187
Yeah... I was. i fixed it
LVL 16

Expert Comment

ID: 9629381
That's OK, just see posting time for each comment. Cheers

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question