borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Recordset Cursor?)Next Topic (Text Box Formatting in Forms) New Topic New Poll Post Reply
AndreaVB Forum : Database : What does it mean?
Poster Message
user777
Level: Scholar

Registered: 18-09-2005
Posts: 40

icon What does it mean?

Hi,

Why this code is written for. Could somebody help me to understand the code?

Private Sub text5_Change()
If rs.RecordCount <> 0 Then
ctrl_unlock
Else
ctrl_lock
End If
End Sub


____________________________
user777

13-10-2005 at 10:06 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 530
icon Re: What does it mean?

you should search for some kind of sub or function defined somewhere in your code (in a module) named "ctrl_unlock" and "ctrl_lock", these are not biult-in commands.

____________________________
AndreaVB

13-10-2005 at 10:56 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: What does it mean?

Hi,
judging from the name of the routines (ctrl_lock and ctrl_unlock), this is the "english" version of this code:

"Whenever the contents of the textbox called Text5 are changed (by code or by user typing), check if there are records in the recordset called rs. If there are, then enable the controls (presumably to allow editing), if not, disable the controls."

It doesn't seem very logical to check this on a change of a text value to me, but that is what it appears to do!

Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

13-10-2005 at 11:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
kibzama
Level: Big Cheese


Registered: 05-09-2005
Posts: 28
icon Re: What does it mean?




To add on what Admin said, It means that, there is a control (most lokely a textbox) named text5. When the text in the text in the control changes then a recordset named rs is checked, if its not empty then a module named ctrl_unlock is run otherwise another module named ctrl_lock is run.

kibzama

13-10-2005 at 11:32 AM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: What does it mean?

I agree with other suggestions. I also suspected that the code is using or calling ActiveX control or funtion.

____________________________
Im JAMES  

18-10-2005 at 02:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: What does it mean?

Hi TJ,
How do you deduce the presence of an ActiveX control from the sample code?  
Curious Kieron

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

18-10-2005 at 08:48 AM
View Profile Send Email to User Show All Posts | Quote Reply
kibzama
Level: Big Cheese


Registered: 05-09-2005
Posts: 28
icon Re: What does it mean?

quote:
How do you deduce the presence of an ActiveX control from the sample code?



I think TJ 's conclusion or rather proposition is based on the underscores after the name ctrl. However this would be so if ctrl_lock and ctrl_unlock were events, but they are methods. ActiveX control methods by standards are not named like this. I stand to be corrected, but my view is that its a notmal textbox. Though by definition its also an activeX control.

kibzama
18-10-2005 at 10:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: What does it mean?

quote:
stickleprojects wrote:
Hi TJ,
How do you deduce the presence of an ActiveX control from the sample code?  
Curious Kieron


Im sorry. I mean is a calling a function located in .bas module or in the form . Thanx for the corrections mate. Maybe im thinking of something while im answering.





[Edited by TJ_01 on 19-10-2005 at 12:54 AM GMT]

[Edited by TJ_01 on 19-10-2005 at 01:06 AM GMT]

____________________________
Im JAMES  
19-10-2005 at 12:52 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : What does it mean?
Previous Topic (Recordset Cursor?)Next Topic (Text Box Formatting in Forms) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder