Solved

Creating simple object

Posted on 2000-03-30
4
122 Views
Last Modified: 2013-11-25

HI all, I am trying to learn object oriented techniques in vb. I know the
question i am asking is probably very easy one but neverthe less i need help
with it. Let's say i want to design a method in my class that will do validations.
Say i want to see if the textboxes are all field. So i create a isComplete()
method. So in my form i then call this method and pass parameters to it.
ex. Set oCheck = New iCheck
     oCheck.isComplete text1,text2
end example...
but right after i call oCheck method i need to call another method let's
call it Register. But if isComplete returns that not all textboxes have been
filled i don't want to call Register method. How do i do that ?

I was suggested to do this. But i did't understood what the property Varified meant. Here is what the person suggested.
4 options (not mutually exclusive) out of probably many, many more:
1. make "IsComplete" a function and return a boolean for success:
      If oCheck.IsComplete(text1.text,text2.text) Then
2. Add a "Verified" property to the object:
      Call oCheck.IsComplete(Text1.Text,Text2.Text)      If oCheck.Verified Then
3. Raise an error in the IsComplete routine if it fails and use Error
Trapping in the client
4. Raise an event in the IsComplete routine and set a flag in the client

I would appriciate any feedback
0
Comment
Question by:vbRetard
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
tkuppinen earned 15 total points
ID: 2670328
These are all valid approaches but the simplest one is probably number 1.  Numbers 3 and 4 are just too much work for something like this.
0
 

Author Comment

by:vbRetard
ID: 2670334
Ok here is a bit more information. After i call isComplete method i pass there values 4 values to be exactly. The values are seen if they are filled. Then i need to use another method isPws to see if passwords match. Then if they do i need to call another method which will send that information into a database. Does any one understand what i mean ? Please provide some help. Thanks a lot.
0
 
LVL 1

Expert Comment

by:tkuppinen
ID: 2670390
A little more info please.  Is this just a "login" type screen?  Do you just want to check for a value that exists in a database ?
0
 
LVL 6

Expert Comment

by:Marine
ID: 2670546
can  you just explain me how i can this done ? This is not for a login screen. This is going to be later update the information into a database. This is just for my understanding of classes. I want to create an object that will use isComplete event that will check to see if textboxes are emtpy. I have no problem there. I create that method and pass the values to that event. Then i make it return True | False if its empty or not. Then i use isPws method to see if passwords are exact. If they are i then call another method that will write that info taken from the textboxes into a database. All this is going to be for registration screen. I would appriciate your help a lot on this. I have more ideas on this but i don't know if i will be able to express them correctly. Thanks again for the help.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot enter table caption text in Word protected document 6 110
Sending a email via excel using vba 6 71
VB6 - Compare and highlight cell not the same 3 42
Hide vba in gp 7 82
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now