Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 43
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    We already confirmed that CanShrink is not the issue. Doesn't matter the size of textbox, records are still there.
    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.

  2. #17
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    We already confirmed that CanShrink is not the issue. Doesn't matter the size of textbox, records are still there.
    yes but I want to make sure those fields that do not match the date are not summed with the fields that do...

  3. #18
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    And that's where you lose me because I don't understand your data. Sounds like a condition dependent on data in same field of another record and maybe you need another group in the report. The date changes, that is a new group.
    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.

  4. #19
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Here is a basic idea of what I am attempting to acheive - however for some reason the combo box isn't working correctly as it should show results in on the record that match the dates - I figure you will be able to see which anyway

    https://www.dropbox.com/s/5ecncgot1pddi6t/Database3.zip

    now if you made any textboxes null if the corresponding date wasn't the same as txtDate then you would shrink it and not sum it with the rest

    money1 and money1date are together even though they are on the same record (we just have to understand they are even though this is not the correct way of doing it).

    now if money1date does not equal txtDate then
    null
    money 1 and money2

    and then

    if null, report will collapse those fields with canshrink (just to avoid showing the fields with the dates that do not match).

  5. #20
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	27.6 KB 
ID:	14517

    For example this record shows the two different payment fields however the dates are different (even though the booking date is the same) since the payment date is different - I have that become null and hide using canshrink - then I want to sum all the payments I see even though they are different fields.

    field1 (if not made null) + field2 (if not made null)

    now sum any fields either field1 and field 2 across all records that are still showing...

    the 18/11/2013

    and 25/11/2013

    are the same record - just different fields.

  6. #21
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Updated to working

    https://www.dropbox.com/s/pim0hq2vxw...atabase3.1.zip

    put 5/1/2013 in for the date field

  7. #22
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    And an example of the error I get

    https://www.dropbox.com/s/j0ptfnsndg...atabase3.2.zip

    (if summing text fields doesn;t work this will explain the error I get)

    I had to rearrange the junction to get proper results so I will update this later to give a better example.

  8. #23
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The last sample db provided is not set up as described in your posts. There are no textboxes calculated to null and none are set to shrink. However, I might have some understanding now.

    If any of the pay dates does not equal the criteria date, don't include that payment in the sum? Maybe:

    =Sum(IIf([DatePaid1]<>[txtDate],0,Nz([Money1],0))+IIf([DatePaid2]<>[txtDate],0,Nz([Money2],0))+IIf([DatePaid3]<>[txtDate],0,Nz([Money3],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.

  9. #24
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    The last sample db provided is not set up as described in your posts. There are no textboxes calculated to null and none are set to shrink. However, I might have some understanding now.

    If any of the pay dates does not equal the criteria date, don't include that payment in the sum? Maybe:

    =Sum(IIf([DatePaid1]<>[txtDate],0,Nz([Money1],0))+IIf([DatePaid2]<>[txtDate],0,Nz([Money2],0))+IIf([DatePaid3]<>[txtDate],0,Nz([Money3],0)))
    edit - will check this one

    I get an error if I put it both in the page and report footer

    I don't get it calculating sometimes (0) and other times it calculates both...

    https://www.dropbox.com/s/3z6mhlde5s...atabase3.4.zip

  10. #25
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by Ruegen View Post
    edit - will check this one

    I get an error if I put it both in the page and report footer

    I don't get it calculating sometimes (0) and other times it calculates both...

    https://www.dropbox.com/s/3z6mhlde5s...atabase3.4.zip
    I don't think it will work because when it gets 1 record and it is blank then it doesn't sum all the records for that one field...

    I had discussions with work and I might have to just make a button that duplicates the record but hides it from common view to make extra payments on the same booking. - same date and copy over the teacher id into a new field just as a reference to relate it.

    I'd have to sum each record first , then sum the summed records for this to work...

  11. #26
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I removed the dd/mm/yyyy formatting from txtDate textbox.

    I fixed the Sum expression (I forgot to include form qualifier):

    =Sum(IIf([DatePaid1]<>[Forms].[Form1]![txtDate],0,Nz([Money1]))+IIf([DatePaid2]<>[Forms].[Form1].[txtDate],0,Nz([Money2]))+IIf([DatePaid3]<>[Forms].[Form1].[txtDate],0,Nz([Money3])))

    I removed the Requery line from the procedure because it's just unnecessary.

    Now the form/subreport definitely work.
    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.

  12. #27
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    I removed the dd/mm/yyyy formatting from txtDate textbox.

    I fixed the Sum expression (I forgot to include form qualifier):

    =Sum(IIf([DatePaid1]<>[Forms].[Form1]![txtDate],0,Nz([Money1]))+IIf([DatePaid2]<>[Forms].[Form1].[txtDate],0,Nz([Money2]))+IIf([DatePaid3]<>[Forms].[Form1].[txtDate],0,Nz([Money3])))

    I removed the Requery line from the procedure because it's just unnecessary.

    Now the form/subreport definitely work.
    ok I will give that a go

  13. #28
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    I removed the dd/mm/yyyy formatting from txtDate textbox.

    I fixed the Sum expression (I forgot to include form qualifier):

    =Sum(IIf([DatePaid1]<>[Forms].[Form1]![txtDate],0,Nz([Money1]))+IIf([DatePaid2]<>[Forms].[Form1].[txtDate],0,Nz([Money2]))+IIf([DatePaid3]<>[Forms].[Form1].[txtDate],0,Nz([Money3])))

    I removed the Requery line from the procedure because it's just unnecessary.

    Now the form/subreport definitely work.
    I did what you suggested however I am still not getting a sum

    https://www.dropbox.com/s/zras2ztmvb...atabase3.5.zip

  14. #29
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by Ruegen View Post
    I did what you suggested however I am still not getting a sum

    https://www.dropbox.com/s/zras2ztmvb...atabase3.5.zip
    wait, I put format(txt.datefield,"mm/dd/yyyy") on the after update vba and it works!

    I will see if I can replicate this on the company database - should work the same

    fingers crossed*

  15. #30
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    I'm getting an #error still on the company one

    I am using

    =Sum(IIf([PaymentDepositDateBanked]<>[Forms].[frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentDepositReceived]))+IIf([PaymentDateBanked1st]<>[Forms].[frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived1st]))+IIf([PaymentDateBanked2nd]<>[Forms].[frmCompanyTaxInvoices]![txtDate],0,Nz([PaymentReceived2nd])))


    to hide the fields I am using (each is different but they follow the same practice)

    =IIf([PaymentDepositDateBanked]<>[Forms]![frmCompanyTaxInvoices]![txtDate],Null,IIf(IsNull([PaymentDepositReceived]),Null,[PaymentDepositDateBanked]))


    and my afterupdate is

    Me.rptCompanyTaxInvoices.Report.Filter = "(PaymentDateBanked1st=#" & Format(Me.txtDate, "mm/dd/yyyy") & "# Or PaymentDateBanked2nd=#" & Format(Me.txtDate, "mm/dd/yyyy") & "# Or PaymentDepositDateBanked=#" & Format(Me.txtDate, "mm/dd/yyyy") & "#) And TradingAsID=" & Me.CmbCompany
    Me.rptCompanyTaxInvoices.Report.FilterOn = True

    could there be something I should be looking out for in theory that could cause the error?

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

Similar Threads

  1. Replies: 11
    Last Post: 09-21-2013, 04:53 AM
  2. Linked Tables Giving Error Message
    By 18ck in forum Access
    Replies: 2
    Last Post: 11-23-2012, 06:30 AM
  3. DCount on a Query giving #Name? error
    By Huddle in forum Access
    Replies: 9
    Last Post: 06-20-2012, 11:40 AM
  4. DLookUp function giving invalid use of null error
    By shubhamgandhi in forum Programming
    Replies: 4
    Last Post: 07-21-2011, 06:04 PM
  5. NoData() still giving me an error.
    By cowboy in forum Programming
    Replies: 3
    Last Post: 04-08-2010, 12:26 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