S
Steven Lyday
I am writing my first Class Module and using the Property
Statement for the first time. I have NOT had a problem
with Property Let and Property Get utilizing one (1)
argument. The problem is when I ADD a second (2) argument.
All of the avilable documentation describe the use of
multiple arguments. Unfortunately none of the examples
utilize more than one (1) arguement.
The WORKING code is a Write Only property (No Get Pair)
that sucessfully selects the designated field in the
current record:
========================================
(1) Called by:
Dim curTbl As CStdTableR_W_DAO
Set curTbl = New CStdTableR_W_DAO
curTbl.LetFieldData = ("Accountnumber")
========================================
========================================
Public Property Let LetFieldData(ByVal strFieldName As String)
' This Property Sets the Value of the Specified Field in
the Current Rec
Dim mcurDB As DAO.Database
Dim mrst As DAO.Recordset
Dim fld As DAO.Field
Set mcurDB = CurrentDb()
Set mrst = mcurDB.OpenRecordset("T-Transactions")
mrst.MoveFirst
For Each fld In mrst.Fields
If fld.NAME = strFieldName Then
' .... Res for Code to write Data
Exit For
End If
Next
End Property
====================================================
(2)I then add 'ByVal strFieldData as String' to the
property declare statement to include the variable for the
field data.
Public Property Let LetFieldData(ByVal strFieldName As
String, ByVal strFieldData as String)
====================================================
(3)I Comment out the calling statement.
'curTbl.LetFieldData = ("Accountnumber", "1234567890")
The code compiles successfully.
====================================================
(4) I remove the comment from the calling statement &
recompile.
====================================================
curTbl.LetFieldData = ("Accountnumber", "1234567890")
Error = "Compile Error Expected )" Error occurs at the comma.
-----------------------------------------------------
curTbl.LetFieldData = "Accountnumber", "1234567890"
Error = "Compile Error Expected end of statement" Error
occurs at the comma.
======================================================
5. When I type in the calling statement, When Intellisense
appears, it only identifies the first arguement.
I would appreciate an direction provided!
TIA and Re,
Steven Lyday
Statement for the first time. I have NOT had a problem
with Property Let and Property Get utilizing one (1)
argument. The problem is when I ADD a second (2) argument.
All of the avilable documentation describe the use of
multiple arguments. Unfortunately none of the examples
utilize more than one (1) arguement.
The WORKING code is a Write Only property (No Get Pair)
that sucessfully selects the designated field in the
current record:
========================================
(1) Called by:
Dim curTbl As CStdTableR_W_DAO
Set curTbl = New CStdTableR_W_DAO
curTbl.LetFieldData = ("Accountnumber")
========================================
========================================
Public Property Let LetFieldData(ByVal strFieldName As String)
' This Property Sets the Value of the Specified Field in
the Current Rec
Dim mcurDB As DAO.Database
Dim mrst As DAO.Recordset
Dim fld As DAO.Field
Set mcurDB = CurrentDb()
Set mrst = mcurDB.OpenRecordset("T-Transactions")
mrst.MoveFirst
For Each fld In mrst.Fields
If fld.NAME = strFieldName Then
' .... Res for Code to write Data
Exit For
End If
Next
End Property
====================================================
(2)I then add 'ByVal strFieldData as String' to the
property declare statement to include the variable for the
field data.
Public Property Let LetFieldData(ByVal strFieldName As
String, ByVal strFieldData as String)
====================================================
(3)I Comment out the calling statement.
'curTbl.LetFieldData = ("Accountnumber", "1234567890")
The code compiles successfully.
====================================================
(4) I remove the comment from the calling statement &
recompile.
====================================================
curTbl.LetFieldData = ("Accountnumber", "1234567890")
Error = "Compile Error Expected )" Error occurs at the comma.
-----------------------------------------------------
curTbl.LetFieldData = "Accountnumber", "1234567890"
Error = "Compile Error Expected end of statement" Error
occurs at the comma.
======================================================
5. When I type in the calling statement, When Intellisense
appears, it only identifies the first arguement.
I would appreciate an direction provided!
TIA and Re,
Steven Lyday