You can enter SQL WHERE clause statements of up to 32,768 characters in VBA. If you need to enter a more complex SQL WHERE clause longer than this, use the OpenForm method of the DoCmd object in a Visual Basic for Applications (VBA) module instead. Note: The maximum length of the Where Condition argument is 255 characters. Replace formname and controlname on other form with the name of the other form and the control on the other form that contains the value you want records in the first form to match. Replace fieldname with the name of a field in the underlying table or query of the form you want to open. To open a form and restrict its records to those specified by the value of a control on another form, use the following expression: If you select a filter with the Filter Name argument, Access applies this WHERE clause to the results of the filter. However, the query must include all the fields in the form you are opening or have its OutputAllFields property set to Yes.Ī valid SQL WHERE clause (without the word WHERE) or expression that Access uses to select records from the form's underlying table or query. You can enter the name of either an existing query or a filter that was saved as a query. For example, if a form's ViewsAllowed property is set to Datasheet, you can still use the OpenForm action to open the form in Form view.Ī filter that restricts or sorts the form's records. Note: The View argument setting overrides the settings of the form's DefaultView and ViewsAllowed properties.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |