home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Programmer'…arterly (Limited Edition)
/
Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso
/
code
/
ch06code
/
listings
/
06list03.txt
< prev
next >
Wrap
Text File
|
1995-08-10
|
1KB
|
28 lines
Listing 6.3[em]How To Access the Value of a Calculated Field and How To Name the Field
'********************************************
'Set up the SELECT statement without the name
'********************************************
Dim NewDyn As RecordSet
SQL = "SELECT Lastname & ', ' & Firstname FROM Customers"
'****************************************
'Create a Dynaset from the SQL statement
'****************************************
NewDyn = OldDb.OpenRecordset(SQL)
'**********************************
'Get the value of the created field
'**********************************
Person = NewDyn.Recordset(0)
'**********************************************************
'Set up the SELECT statement and assign a name to the field
'**********************************************************
SQL = "SELECT Lastname & ', ' & Firstname As Name FROM Customers"
'****************************************
'Create a Dynaset from the SQL statement
'****************************************
NewDyn = OldDb.OpenRecordset(SQL)
'**********************************
'Get the value of the created field
'**********************************
Person = NewDyn.Recordset("Name")