473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

AXP and Implements

I was trying to use interfaces in Access XP, following the only page available
in VBA help, the one relative to Implements keyword.

Here are the class modules I prepared:

1) clsPersonalData
==========================
Option Compare Database
Option Explicit

Public Name As String
Public Address As String
==========================

2) clsCustomer
==========================
Option Compare Database
Option Explicit

Implements clsPersonalData

Private Property Get PersonalData_Address() As String
PersonalData_Address = "CustomerAddress"
End Property

Private Property Let PersonalData_Address(ByVal RHS As String)
'
End Property

Private Property Let PersonalData_Name(ByVal RHS As String)
'
End Property

Private Property Get PersonalData_Name() As String
PersonalData_Name = "CustomerName"
End Property
==========================

Unfortunately, while compiling I get the following error in clsCustomer class,
at the line with the Implements instruction:
"Object module must implement 'Name' form interface 'clsPersonalData'"

I searched a lot with Google but found noone using interfaces in Access.

May you suggest me?

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it
skype: pbsoftsolution
Apr 26 '06 #1
2 1596

"PBsoft" <in**@REMOVEpbsoft.it> wrote in message
news:87**************************@news.tin.it...
I was trying to use interfaces in Access XP, following the only page
available in VBA help, the one relative to Implements keyword.

Here are the class modules I prepared:

1) clsPersonalData
==========================
Option Compare Database
Option Explicit

Public Name As String
Public Address As String
==========================

2) clsCustomer
==========================
Option Compare Database
Option Explicit

Implements clsPersonalData

Private Property Get PersonalData_Address() As String
PersonalData_Address = "CustomerAddress"
End Property

Private Property Let PersonalData_Address(ByVal RHS As String)
'
End Property

Private Property Let PersonalData_Name(ByVal RHS As String)
'
End Property

Private Property Get PersonalData_Name() As String
PersonalData_Name = "CustomerName"
End Property
==========================

Unfortunately, while compiling I get the following error in clsCustomer
class, at the line with the Implements instruction:
"Object module must implement 'Name' form interface 'clsPersonalData'"

I searched a lot with Google but found noone using interfaces in Access.

May you suggest me?

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it
skype: pbsoftsolution



I can't see exactly what you are trying to achieve, but it looks vaguely
like you are trying to create a Customer object based on a Person object -
although I wouldn't use your convention to name my classes.
Perhaps this example will help:

' ----------------------------------------
' Saved in a class module named Person
Option Compare Database
Option Explicit

Public Property Get FirstName() As String
End Property

Public Property Let FirstName(strFirstName As String)
End Property
' ----------------------------------------


' ----------------------------------------
' Saved in a class module named Customer
Option Compare Database
Option Explicit

Implements Person

Private m_strFirstName As String

Private Property Let Person_FirstName(RHS As String)
m_strFirstName = RHS
End Property

Private Property Get Person_FirstName() As String
Person_FirstName = m_strFirstName
End Property
' ----------------------------------------

' ----------------------------------------
' Saved in a form module named frmTestMe
Private Sub cmdTest_Click()

' Test my classes:
Dim x As Person

Set x = New Customer

x.FirstName = "Peter"

MsgBox "I am a customer." & vbCrLf & _
"I am a type of person." & vbCrLf & _
"My name is " & x.FirstName & ".", _
vbInformation, "Hello"

Set x = Nothing

End Sub
' ----------------------------------------



Apr 26 '06 #2
I appreciated your help.

Thanks.

--
PBsoft di Gabriele Bertolucci
www.pbsoft.it
skype: pbsoftsolution
Apr 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6941
by: Doug van Vianen | last post by:
I am fairly new to Java but have written an applet that uses 'implements Runnable' to do some timing eg public class Puzzle extends Applet implements Runnable { etc. and also an applet which...
2
3422
by: Todd Brooks | last post by:
I have a coclass that implements a dual interface. The thing that's a little unusual is that the coclass doesn't inherit directly from the interface, rather it inherits from an implementation class...
6
1108
by: Klaus Löffelmann | last post by:
Hello, why is it necessary to implement every procedure of an interface by assigning it manually with another "implements" to the corresponding procedure of the class, which actually...
0
1300
by: ns2k | last post by:
I tried to implements Microsoft.Office.Core.Range Interface, but the dot net raise errors : + ' '_Default' cannot implement '_Default' because there is no matching property on interface 'Range'.'...
5
5817
by: owais | last post by:
Hi, I have a problem, I want to implements Parent class interface methods in child class. for e.g -------------- Test1.vb ---------------- Imports System Imports System.Web.UI Imports...
7
5357
by: Chris Lane | last post by:
Hi, I have the following class declaration and the ide is giving the following errors. Interface 'System.Web.UI.IPostBackDataHandler' is already implemented by base class...
4
1640
by: reon | last post by:
Hi In this program i tried implements,inheritance (I tried multiple inheritance in C++). In C++ I knew that multiple inheritance means we can invoke all classes and class functions from derived...
1
1836
by: Christian Welzel | last post by:
Hi there! Currently i'm thinking about how to solve this problem: if (t3lib_div::int_from_ver(phpversion())<5000000) { // php4 class tx_lib_object extends tx_lib_selfAwareness {...} // }...
3
1596
balabaster
by: balabaster | last post by:
Hey, I've been trawling documentation for this, but can't figure out what it's called so I'm running short of answers: In VB say you build some interface: Interface IDemoInterface Sub...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.