Results 1 to 8 of 8
  1. #1
    taahir321 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    4

    Text Box controle problem in report

    Hi Dears,



    I have been tryieng to put following code in a text box controle in a report footer but it generates error message "#error". Can someone help me out of this trouble!

    Best regards,


    Tahir



    =Sum(IIf([StrM]>[EndM],IIf([StrH]>[EndH],(((24*([EndDate]-[StrDate]))-(([StrH]-[EndH]))-1)),(24*([EndDate]-[StrDate]))+(([EndH]-[StrH]))-1) & "." & (60-([StrM]-[EndM])),IIf([StrH]<[EndH],(((24*([EndDate]-[StrDate]))+([EndH]-[StrH]))),(24*([EndDate]-[StrDate]))-([StrH]-[EndH])) & "." & ([EndM]-[StrM])))

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Try this:

    Start again and build your string one piece at a time and see if you get an error at each step.

    Also - try & see if each part of what you are trying to display in the textbox is correctly displaying.

    I suspect some confusion in the number of parentheses. I counted and the open parens & close parens were not matching in number.

    Is your textbox large enough for the data?

  3. #3
    taahir321 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    4
    Thanks!
    I will try your suggession

    Best regards,

    Tahir

  4. #4
    taahir321 is offline Novice
    Windows Vista Access 2007
    Join Date
    Sep 2011
    Posts
    4
    Hello!
    Hope you are fine. I am attaching a database. in it please open report RSputt and see error in the report footer.

    in fact i have been developing an equipment log where with the hepl of (start date ---start time ) and (Enddate ---End time) running or usage time of an equipment is calculated. I have submitted just the relavent portion of the database. Please see and help me find a solution to this problem.


    Best regards,





    Quote Originally Posted by Robeen View Post
    Try this:

    Start again and build your string one piece at a time and see if you get an error at each step.

    Also - try & see if each part of what you are trying to display in the textbox is correctly displaying.

    I suspect some confusion in the number of parentheses. I counted and the open parens & close parens were not matching in number.

    Is your textbox large enough for the data?

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Did you try this:

    Start again and build your string one piece at a time and see if you get an error at each step.
    ??

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Taahir,
    In your =Sum . . . expression, can you describe to me what will be displayed if the expression is True and what will be displayed if the expression is False?

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Try this in your Text Box:

    Code:
     
    =IIf([StrM]>[EndM],IIf([StrH]>[EndH],(((24*([EndDate]-[StrDate]))-(([StrH]-[EndH]))-1)),(24*([EndDate]-[StrDate]))+(([EndH]-[StrH]))-1) & "." & (60-([StrM]-[EndM])),IIf([StrH]<[EndH],(((24*([EndDate]-[StrDate]))+([EndH]-[StrH]))),(24*([EndDate]-[StrDate]))-([StrH]-[EndH])) & "." & ([EndM]-[StrM]))
    When I ran the report with that - the Text Box displayed 745.57.

    Let me know if this is what you needed.

  8. #8
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Is this solved?

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

Similar Threads

  1. formula in text box problem
    By kwooten in forum Reports
    Replies: 7
    Last Post: 09-12-2011, 08:19 AM
  2. Text/Number Relationship Problem
    By Luke in forum Access
    Replies: 4
    Last Post: 07-07-2011, 11:29 AM
  3. program a text box in a report!
    By NateHaze in forum Programming
    Replies: 1
    Last Post: 06-07-2011, 05:55 AM
  4. Imput Mask problem (TEXT)
    By Danzig in forum Forms
    Replies: 3
    Last Post: 10-28-2010, 06:47 PM
  5. report text scrolls away when try to C & P
    By noniknonik in forum Access
    Replies: 0
    Last Post: 06-09-2009, 07:04 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