Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 39
  1. #16
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Thanks Steve. Basic error!!


    Sent from my iPhone using Tapatalk

  2. #17
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    sorry friends i have to tell you that i'm working with accss 2010 . I hope that's not the problem but if i try to upload a new tbltilt
    the message yet appears:

    errore di run time '3144':
    errore di sintassi nell'espressione UPDATE


    so if I press the debug button it appears:

    sqlstring = "UPDATE tbltilt_full SET tbltilt_full.[values] =" & updateval & " WHERE (([tbltilt_full].[code]=" & Chr(34) & rs.Fields("code") & Chr(34) & "));"

    CurrentDb.Execute (sqlstring) is highlited in yellow

    rs.MoveNext
    i = i + 1
    Loop



  3. #18
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Did you use my updated version when you uploaded a new version.




    Sent from my iPhone using Tapatalk

  4. #19
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    I imported a new table and I have overwritten the existing one.
    Then I opened the mask. I set it the number of systems and the number of tilt.
    I pressed the first button, and everything went well.
    I pressed the second and popped the error.
    looking at the query it is seen that the codes have been generated for null fields but also that the numerical values ​​do not appear.
    I am attaching your file with the new table
    Attached Files Attached Files

  5. #20
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Have you changed your system names?

    they've gone from a,b,c to s and c?

    It would help to know what the system letters are gonna be

  6. #21
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    The highlighted line assumed the systems were a to z as your initial messages suggested. If you want to change the list (as I've done as you have given systems s and c) then you can make any changes.


    Code:
    Private Sub Command6_Click()
    Dim alphabet As String
    Dim numbers As Variant
    Dim db As Database
    Set db = CurrentDb
    Dim mysql As String
    DoCmd.SetWarnings False
    DoCmd.RunSQL "DELETE * FROM tbltilt_full"
    DoCmd.SetWarnings True
    alphabet = "scabcdefghijklmnopqrstuvwxyz" 'systems available

  7. #22
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    system could be a name like mike1 or a single letter like b , a c but often a name

  8. #23
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Ok leave it with me. I'm assuming your imported file will always have all the system names on there


    Sent from my iPhone using Tapatalk

  9. #24
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    sumvalueswithcondition - Copy1111.zip

    How's this?

    I've adjusted the code above to extract how many systems you have (from your download) and what they are called

    Andy

  10. #25
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    the same error appears if i import a new table.
    it'll be most simple if i tell you that the name of systems are not important?to the end i have to sum valus of system each checkpoint and each tilt with the condition that there aren't null contribute so if for any checkpoint and tilt one of the system doesn't have values i have to consider, for that system, his first not null or the last not null.
    to the end I need
    chekpoint , tilt, sumwithcondition of system values.
    now I'm attaching a realistic input table that I have to use.
    I'm asking your help becouse I need an application that became me able to repeat the operation with more than one input table (everytime different number of checkpoint,of system,of tilt but the same condition ever)
    I'm sending some types of tables i have to use
    Attached Files Attached Files

  11. #26
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    sumvalueswithcondition.zip

    Can you do a test run on this?

  12. #27
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    when i try with another table the error message yet appears
    Attached Files Attached Files

  13. #28
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Quote Originally Posted by g.adamo@email.it View Post
    when i try with another table the error message yet appears
    Can you send me a screen shot of the table tbltiltfull please

    Or even better

    Can you run a query on tbltiltfull returning null and zero values?

  14. #29
    g.adamo@email.it is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    18
    test 1)
    I imported a new table tbltilt, I opened the form1 and I pressed button 1 ok. I pressed button 2 and the message erroe appeared. see attached file to see tbltiltfull
    test 2)
    I imported a new table tbltilt, I cancelled all records on tbltiltfull, I opened form1 but it was white page . see attached file

    on test 1 e 2
    I imported a new table gsm. I copied the recordset of gsm and I put these on tbltilt
    Attached Files Attached Files

  15. #30
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Unhappy Can you run this on your computer as it stands

    sumvalueswithcondition2.zip


    See if this version runs



    Should this fail on an error, can you debug and copy the update statement in the immediate window which has the largest number at the beginning.

    Then copy and paste it back on here

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

Similar Threads

  1. Add second where condition
    By tagteam in forum Access
    Replies: 4
    Last Post: 03-22-2016, 03:46 PM
  2. Spread values ​​by date in query
    By arn0ldas in forum Access
    Replies: 2
    Last Post: 12-15-2015, 04:23 AM
  3. Replies: 6
    Last Post: 02-25-2014, 12:48 AM
  4. Replies: 4
    Last Post: 11-19-2013, 06:53 PM
  5. Replies: 1
    Last Post: 12-14-2010, 10:03 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