Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Unanswered: Form based on a query

    Hello.
    I have created a form "Coating Weights" based off a query "Coating Weight Query". There are a few fields that perform simple calculations, such as SampleArea (which is [SampleLength x SampleWidth] ). I have a few questions about these types of fields.
    1. When you first open the form, all of the number fields displayed "0" before any data was ever entered into the form. I do not want these zeros to display EVER, unless someone actually types a 0. I looked at another forum regarding this situation and the solution was to set the Default Value to "null", which I did. However, this only works until you start entering data. For example, open the form and all fields are blank. Then I enter information into the "Date" field, then every number field changes to 0. How do I make these fields remain empty/null until someone actually types a number in them?
    2. As a result of the situation above, I have 2 fields that have a division calcluation in them, therefore resulting in the #Error being displayed. I feel like if the first situation is resolved, this situation will also be resolved. I believe it's an error resulting from dividing by 0.
    3. One of the fields I have "CoatingWeight" is a very simple subtraction field: [CoatedWeight - UncoatedWeight]. Both CoatedWeight and UncoatedWeight have their decimal places set to 4. However, when subtracting 49.8833-49.2527, Coating Weight displays 0.63060000001. I have tried setting this field CoatingWeight to 4 decimal places but it is ignoring me!!! LOL. Besides, where on earth did it get the additional 0000001???? Can someone help me fix this situation as well?
    Thanks!!!

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Post the SQL from your query please - In query design view, click View > SQL and copy and paste the text.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    SELECT [Coating Weights].[Work Request Number], [Coating Weights].[Sample Number], [Coating Weights].GaugeE1, [Coating Weights].GaugeC, [Coating Weights].GaugeE2, [Coating Weights].[E1CoatedWeight(a)], [Coating Weights].[E1UncoatedWeight(b)], [Coating Weights].[CCoatedWeight(f)], [Coating Weights].[CUncoatedWeight(g)], [Coating Weights].[E2CoatedWeight(h)], [Coating Weights].[E2UncoatedWeight(j)], [Coating Weights].[Coating Type], [Coating Weights].DateTested, [Coating Weights].[Tested By], [Coating Weights].Side, [E1CoatedWeight(a)]-[E1UncoatedWeight(b)] AS [E1ZnCoatingWeight(d)], [CCoatedWeight(f)]-[CUncoatedWeight(g)] AS [CZnCoatingWeight(e)], [E2CoatedWeight(h)]-[E2UncoatedWeight(j)] AS [E2ZnCoatingWeight(k)], ([E1ZnCoatingWeight(d)]+[CZnCoatingWeight(e)]+[E2ZnCoatingWeight(k)])/3 AS TripleSpot, [Coating Weights].SampleLengthin, [Coating Weights].SampleWidthin, [SampleLengthin]*[SampleWidthin] AS SampleAreain, [Coating Weights].SampleLengthmm, [Coating Weights].SampleWidthmm, [SampleLengthmm]*[SampleWidthmm] AS SampleAreamm, [Coating Weights].SampleCoatedWeight, [Coating Weights].SampleUncoatedWeight, (([SampleCoatedWeight]-[SampleUncoatedWeight])/[SampleAreain])*5.08 AS SampleZnCoatingWeightin, (([SampleCoatedWeight]-[SampleUncoatedWeight])/[SampleAreamm])*3280 AS SampleZnCoatingWeightmm
    FROM [Coating Weights];

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •