mwolfe02
mwolfe02

Reputation: 24207

Set Recordset Type of QueryDef via VBA

I can set the Recordset Type of a select query in Access (2002) by opening the query in design view, opening its property sheet, and changing the Recordset Type property to one of three values:

I can't figure out how to set the property through VBA, though. Am I missing something obvious?

Upvotes: 1

Views: 3830

Answers (1)

Fionnuala
Fionnuala

Reputation: 91356

I am not sure about this:

Dim qdf As QueryDef

Set qdf = CurrentDb.CreateQueryDef("test", "select * from atable")
qdf.Properties.Append qdf.CreateProperty("RecordsetType", dbByte, 2)

Upvotes: 3

Related Questions