Re: Access VBA update recordset error
From: Val Mazur (group51a_at_hotmail.com)
Date: 10/30/04
- Next message: Val Mazur: "Re: MDAC 2.8 vs MDAC 2.7"
- Previous message: Val Mazur: "Re: How to Write into Excel"
- In reply to: cityofgp: "Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 29 Oct 2004 21:46:16 -0400
Hi,
To avoid any problems with the spaces in a field names, wrap them into
square brackets and use aliases as Brendan suggested.
If you get syntax error, then most likely you have a field name, which is a
reserved word, like Name, date etc. In this case you would nee to wrap those
field names into square brackets as well.
-- Val Mazur Microsoft MVP "cityofgp" <cityofgp@discussions.microsoft.com> wrote in message news:FB8B3D87-5187-44A8-A150-4609ED660939@microsoft.com... > Using ADODB.recordset and connection, I can successfully update records > using: > > rs![field1] = "blah" > rs.update > > However, when I have a field name with a space as follows: > > rs![field 1] = "blah" > rs.update > > I get a syntax error message. > How can I update fields that have spaces in the field name? What syntax do > I > use? > > TIA. >
- Next message: Val Mazur: "Re: MDAC 2.8 vs MDAC 2.7"
- Previous message: Val Mazur: "Re: How to Write into Excel"
- In reply to: cityofgp: "Access VBA update recordset error"
- Messages sorted by: [ date ] [ thread ]