Modules & how to use 
Author Message
 Modules & how to use

Hi, using VB5 im having trouble using a module with the error Object
required.

The txttime textbox is on my form and would work if i use the code NOW in
the for but when used from the module i get the error.

Here is the code,, its a simple one to test my module

Any help appreciated.

FORM CODE

Public Sub Form_Load()
Timer1.Interval = 1000
End Sub

Public Sub Timer1_Timer()
Call Module1.time
End Sub

MODULE1 Code

Public Sub time()
txttime.Text = Now
End Sub



Sat, 06 Oct 2001 03:00:00 GMT  
 Modules & how to use
if you want to change something in a control from another form or module you
have to name the form first .
In your case :    form1.txttime.text=now

ps call module.time can also be just time

Quote:

>FORM CODE

>Public Sub Form_Load()
>Timer1.Interval = 1000
>End Sub

>Public Sub Timer1_Timer()
>Call Module1.time
>End Sub

>MODULE1 Code

>Public Sub time()
>txttime.Text = Now
>End Sub



Sat, 06 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Class Modules & Modules

2. Q(VB5) : Different between module & class module

3. Class Module & Module

4. VB6 class module turns into regular module using VB6 IDE

5. Modules, Modules, Modules

6. *&*&*&* Date math question *&*&*&*

7. EXIT ICONFIG.EXE MODULE & MMTASK.TSK

8. Modules & Clearing the text fields

9. Modules: OnClose & OnOpen

10. Compiling & Saving Modules

11. Accessing Events Procs & module code through DAO

12. Acc97 - Err 53 & Declare module

 

 
Powered by phpBB® Forum Software