Stuart McLachlan
stuart at lexacorp.com.pg
Sat Oct 11 17:42:46 CDT 2003
On 11 Oct 2003 at 10:33, Hollis,Virginia wrote: > I am having problems with a formatted field. The FailureReportNo is a number > field. > > On a search form, I want to double-click on the failure report number and > open another form that contains all the failure data. > > On the search form I have the FailureReportNo with the Control Source: > =Format([FailureReportNo],"""EF-""00000") > > On the double-click of the FailureReportNo I have: > > stLinkCriteria = "[tblSystemMain].[FailureReportNo]=" & > Me![FailureReportNo] > DoCmd.OpenForm stDocName, , , stLinkCriteria > DoCmd.Close acForm, "frmFind" > > The problem is the search form FailureReportNo field contains #Error & if I > double click on the field (to test it anyway) I get Type Mismatch. Do I have > my quotes wrong? > My guess: You created the textbox by dragggin it from the FieldView window andf then change dthe control source afterwards. As a result, you have the textbox named "FailureReportNo" and are using the field "FailureReportNo" in a function as the control source (causing a circular reference) When you double click, it use the textbox name (Me![FailuyreReportNo]) to build the string stLinkCriteria which becomes "[tblSystemMain].[FailureReportNo]=EF-1234" Either - rename the textbox to txtFailureReportNo or - reset the control source to a simple "FailureReportNo" and format it using the format property of the textbox. -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.