[AccessD] Recordset references

John Colby jwcolby at gmail.com
Tue Sep 7 08:25:40 CDT 2021


+1 on changing the field name.  Field names should never have spaces in
them.

On Mon, Sep 6, 2021 at 8:21 PM <accesspro at cox.net> wrote:

> 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
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


-- 
John W. Colby
Colby Consulting


More information about the AccessD mailing list