[AccessD] Recordset references

accesspro at cox.net accesspro at cox.net
Mon Sep 6 19:21:48 CDT 2021


Unless you are just doing a small repair/mod/feature add, change the field
name now.
And apply your choice of naming conventions. You will be glad later.
If not the other replies are good.

Bob



-----Original Message-----
From: AccessD <accessd-bounces+accesspro=cox.net at databaseadvisors.com> On
Behalf Of Stuart McLachlan
Sent: Monday, September 6, 2021 2:37 PM
To: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Recordset references

Use square brackets.

Function TestName()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Table1") Debug.Print rs![Field one]
rs.Close Set rs = Noth

On 6 Sep 2021 at 17:28, Arthur Fuller wrote:

> Given a DAO recordset based on a table, some of whose fieldnames 
> contain spaces, how does on refer to them? For example:
> stEmployees!FirstName
> 
> Down't work because the actual fieldname is "First Name" not FirstName
> 
> Do I wrap the actual first name fieldname in quotes after the bang? Or 
> what?
> 
> Thanks.
> 
> --
> Arthur
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 


--
AccessD mailing list
AccessD at databaseadvisors.com
https://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list