VbExclamation + vbOKOnly, "Invalid Access" MsgBox "You are not authorized to use this form!", _ VWhere = vWhere & " AND "Valid User" Then If Nz(Me.txtEndDate, "") "" And Nz(Me.txtStartDate, "") = "" Then If Nz(Me.txtEndDate, "") = "" And Nz(Me.txtStartDate, "") "" Then Me.txtStartDate & "# AND #" & Me.txtEndDate & "#" If Nz(Me.txtEndDate, "") "" And Nz(Me.txtStartDate, "") "" Then VWhere = vWhere & " AND =" + Me.cboPayeeID
#GRAVITY FORMS API VBA HOW TO#
The following example shows how to use TextBox controls to supply date criteria for a query. The next two examples show how you might refer to a control named NewData on a subform ctlSubForm contained in the form called OrderForm. The following examples show two of the ways you might refer to a control named NewData on the form called OrderForm. Your code will be faster if you refer to the Controls collection implicitly. Refer to a control on a form either by implicitly or explicitly referring to the Controls collection. SyntaxĮach Form object has a Controls collection, which contains all controls on the form. If the form name includes a space, the name must be surrounded by brackets (). If you want to refer to a specific form in the Forms collection, it's better to refer to the form by name because a form's collection index may change. Refer to an individual Form object in the Forms collection either by referring to the form by name, or by referring to its index within the collection. Within the Forms collection, individual forms are indexed beginning with zero. RemarksĪ Form object is a member of the Forms collection, which is a collection of all currently open forms. A Form object refers to a particular Microsoft Access form.