Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    There are 2 textboxes for the input, but they're on a different form. The two textboxes are on frmEvent, on a subform, and I need the total to be in a column within a textbox on a different form, FrmClient.

    Right now It's almost right. When I have data in both the text boxes on frmEvent, it does show on frmClient, but it shows incorrectly. For example, if I have 2 in one text box, and 30 in the other, it shows "230" on frmClient.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Post the expression you are using. Apparently it is concatenating because both values are seen as strings. The + is a valid concatenation operator (holdover from ancient BASIC).

    What do you mean by column of textbox? Textbox does not have columns.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Come to think of it, it's probably not necessarily columns, but rather a string of information taken form the query.

    The expression I'm using is: Cars Parked: [Actual#CarsGarage] & [Actual#CarsOutside] - I can't use + for some reason. When I do, I don't get anything under "Cars Parked."

    Here is the textbox and the formatting thereof:
    Attached Thumbnails Attached Thumbnails Textbox.png   column widths.png  

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    & is concatenation operator, regardless if data is text or number or date, it will concatenate, not perform arithmetic.

    Review posts 6 and 12.

    Expression in textbox:

    = Nz([Actual#CarsGarage], 0) + Nz([Actual#CarsOutside], 0)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    Perfect. You rock!!

    Now it works perfectly.

    Out of curiosity, what does "Nz" do?

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Did you review the Allen Browne link?

    Nz() is an Access function that provides an alternative value if a field is null.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    bradp1979 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jul 2015
    Location
    San Francisco, CA
    Posts
    234
    I did, and now I understand. What made you choose Nz as opposed to the IIf (MyField is Null, 0, MyField)?

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I showed textbox expression, simpler. However, if you need to use this calculated value in another calc, the IIf() approach might be safer, otherwise:

    = Val(Nz([Actual#CarsGarage], 0) + Nz([Actual#CarsOutside], 0))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 09-08-2014, 06:07 PM
  2. Replies: 5
    Last Post: 06-26-2013, 02:29 PM
  3. Replies: 4
    Last Post: 06-24-2013, 07:12 AM
  4. Replies: 13
    Last Post: 12-05-2011, 05:10 AM
  5. StrComp causing "Invalid use of Null" error
    By sephiroth2906 in forum Programming
    Replies: 5
    Last Post: 09-15-2011, 07:06 PM

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