Time function won't compile 
Author Message
 Time function won't compile

Howdy. I've got a procedure to insert the current time in
a text box on a form when a command button is clicked.
When I compile, I get the error:

Expected variable or function, not project

And the code referenced is the Time function in this line
of code:

    Me.endtime = Time

I've also tried writing "Time()", with the same results.

I've searched all the code in this db, as well as object
names, procedures in modules, etc., and there are no
references whatsoever to any object called simply "Time".

Any ideas? In the meantime, I've replaced the Time()
function with this:

    Me.endtime = Right(Format(Now(), "dd/mm/yy hh:mm"), 5)

Is there any easier way to write this?

Thank you for your help.

Danny



Sat, 09 Jul 2005 12:03:46 GMT  
 Time function won't compile


Quote:
>Howdy. I've got a procedure to insert the current time in
>a text box on a form when a command button is clicked.
>When I compile, I get the error:

>Expected variable or function, not project

Project!? The database isn't named Time, perchance?

The most likely problem is a missing reference. Try opening the VBA
editor and selecting Tools... References; if one is marked MISSING,
uncheck it, recheck it, close and open Access. If it's still marked
MISSING check to see that the .dll file referenced isn't in fact
missing from where Access thinks it should be!

Another getaround is to use =Timevalue(Now()) - but Time() should
work.

                  John W. Vinson[MVP]    
    Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



Sat, 09 Jul 2005 15:02:21 GMT  
 Time function won't compile
Danny,

From any code module, select Tools --> References. Uncheck the one that's
marked MISSING, then find it in the list and re-check it.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia


Quote:
> Howdy. I've got a procedure to insert the current time in
> a text box on a form when a command button is clicked.
> When I compile, I get the error:

> Expected variable or function, not project

> And the code referenced is the Time function in this line
> of code:

>     Me.endtime = Time

> I've also tried writing "Time()", with the same results.

> I've searched all the code in this db, as well as object
> names, procedures in modules, etc., and there are no
> references whatsoever to any object called simply "Time".

> Any ideas? In the meantime, I've replaced the Time()
> function with this:

>     Me.endtime = Right(Format(Now(), "dd/mm/yy hh:mm"), 5)

> Is there any easier way to write this?

> Thank you for your help.

> Danny



Sat, 09 Jul 2005 20:03:16 GMT  
 Time function won't compile
Thanks John. No, the db isn't named "Time". Someone else
suggested "VBA.Time" as the function, and that worked.

Danny

Quote:
>-----Original Message-----
>On Mon, 20 Jan 2003 20:03:46 -0800, "Danny"


Quote:

>>Howdy. I've got a procedure to insert the current time
in
>>a text box on a form when a command button is clicked.
>>When I compile, I get the error:

>>Expected variable or function, not project

>Project!? The database isn't named Time, perchance?

>The most likely problem is a missing reference. Try
opening the VBA
>editor and selecting Tools... References; if one is
marked MISSING,
>uncheck it, recheck it, close and open Access. If it's
still marked
>MISSING check to see that the .dll file referenced isn't
in fact
>missing from where Access thinks it should be!

>Another getaround is to use =Timevalue(Now()) - but Time
() should
>work.

>                  John W. Vinson[MVP]    
>    Come for live chats every Tuesday and Thursday
>http://go.compuserve.com/msdevapps?loc=us&access=public
>.



Sun, 10 Jul 2005 05:01:55 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Module function won't compile in Access 97 Runtime

2. Compiled in Win ME won't run in Win98

3. Another Out of Memory problem, this time it's in compile time

4. Compiled vb exe's won't run

5. Why a compiled executable won't run on client's machine

6. Won't compile....

7. 2000 mdb won't stay compiled

8. won't stay compiled

9. it compiles but won't work!! Help

10. mac word98 Documents.Open won't compile Visible:=

11. AARGH! Now it won't compile

12. ?MS Project COM Template Won't Compile?

 

 
Powered by phpBB® Forum Software