Results 1 to 3 of 3
  1. #1
    alexandervj is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    145

    help with coding please

    I want to write a code for a calculated text field in a datasheet. Right now the calculated text field is just set to ="view runs" but I want it to say "0 runs" if there are no runs in that Lot (for every lot there could be 0 to many runs). Im not sure how to make my IIf statement... every run has a runID and LotID_FK which is the LotID foregin key which is where the LotID is assigned.

  2. #2
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    You can use the Nz function with the count function:

    =Nz(count([runID])) & " runs"

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by alexandervj View Post
    ..I want to write a code for a calculated text field in a datasheet..
    I don't think unbound controls work so swell in datasheet view.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Coding within ADO
    By crowegreg in forum Programming
    Replies: 4
    Last Post: 08-20-2013, 01:34 PM
  2. Coding for Sum in vba
    By glen in forum Programming
    Replies: 14
    Last Post: 12-20-2012, 05:10 PM
  3. Please help with VB coding
    By winterh in forum Import/Export Data
    Replies: 11
    Last Post: 03-19-2012, 06:05 PM
  4. Need help in VBA coding
    By Kcgp in forum Programming
    Replies: 6
    Last Post: 02-01-2012, 11:22 PM
  5. Bar-Coding
    By texasprincess7 in forum Access
    Replies: 1
    Last Post: 02-12-2009, 10:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums