Troubleshooting

graphics/troubleshooting.gif

Run-Time Error '2465'

I receive a "Run-Time Error '2465'" message in Form view.

The most likely cause of this error is failure to change the default Name property value of a combo box or list box to cboCountry, cboProduct, or lblList. Alternatively, you might have misspelled one of the names. Check the Object list for Combo#, Label#, or List# control names. Alternatively, select the Other page of the Properties sheet and select each control object to make sure the Name property value is correct.

Spurious Parameter Messages

A "Parameter" message appears in Form view.

One field name in your SQL statement doesn't correspond to a field name of qryCombo1. Double-check your values of the strSQL1, strSQL2, and strSQL3 constants against the field names included in qryCombo1.

Problems with SQL Statements as Row Source Property Values

My list box doesn't display rows after I make valid selections in the Country and Product lists.

The SQL syntax for the query that populates the list box is incorrect or no orders meet your criteria. If you believe the query should return rows with the criteria you specify, set a breakpoint on the line that sets the RowSource property value of the list box. Repeat the operation that failed and, when the VBA editor opens, press Ctrl+G to open the Immediate window. Type ? and the name of the variable you use to assign the RowSource value to print the value. Break long statements by pressing Ctrl+Enter (see Figure 29.20).

Figure 29.20. Adding a breakpoint and displaying the SQL statement that provides the RowSource property of a list or combo box lets you debug the statement in the Immediate window.

graphics/29fig20.jpg

If you can't determine the source of the problem, copy the SQL Statement to the Clipboard, and then paste it into the SQL window of a Jet Query or the SQL pane of an SQL Server view to test execution. The resulting error message might lead you to the source of the problem.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net