PDA

View Full Version : test for a text box



mud2
04-21-2005, 08:30 AM
When I build (on the fly, with VBA) a form containing a text box, and the form is based on a Record Source SQL that is based on a table, and that contains a variable (in the SQL), AND If the variable is in the table all is well, the text box in the form shows the corresponding entry in the table. BUT, if the variable is NOT in the table the form does NOT have the text box, and tests on the content of the text box result in an error.

Confused?

OBP
04-21-2005, 08:38 AM
It sounds like a "null" value error, if you look at sql query then it will also not hold any values. If your form has another table field on it that does have a value the form will probably work OK even though the text box is blank. You can overcome this by making the default value for your table field either 0 for number values or " " for string values.