The information in this article applies to:
SYMPTOMSTrying to reference the properties of a Recordset or Database using a data control that was passed as Control to a Sub or Function results in this error message: In addition, passing a data control into a Sub procedure as Control may result in a general protection (GP) fault, as it does in this example:
CAUSERecordset and Database specific properties are not available to objects passed as Control. You should replace the "As Control" with "As Data." NOTE: the Data object type is not easy to find in the Visual Basic documentation. It is, however, listed with the other possible object data types in the "Object Variables" popup on the Help menu topic, "Database Objects." Object types include CheckBox, ComboBox, CommandButton, CommonDialog, Control, Data, DirListBox, DriveListBox, FileListBox, Form, Frame, Grid, HScrollBar, Image, Label, ListBox, MDIForm, OptionButton, PictureBox, TextBox, Timer, and VScrollBar. The Professional Edition adds the following additional object types: Database, Dynaset, Field, Fields, Index, Indexes, QueryDef, Snapshot, Table, TableDef, and TableDefs. WORKAROUNDPass the data control as Data. For example, use the following code instead of the code shown below in the MORE INFORMATION section:
MORE INFORMATIONThe following code example gives the error message:
Additional query words: 3.00 gpf
Keywords : |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |