Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43

    Syntax Error in Update statement

    Yep, I still get the error. Currently I'm unable to upload any attachements I keep getting the following error. I've sent an email to the administrator to see if I can get access to uploading files.
    "Your submission could not be processed because a security token was missing.

    If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error."


  2. #17
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43
    I also think that the file is to big. its 76,640KB, i think you're only aloud to upload 500kb.

  3. #18
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Can you copy the database, take out everything except the part that you need help with & THEN try posting it?
    Just leave the Form and the Table[s] needed to run the Form & then save & try & upload?
    Did you try zipping the file?

  4. #19
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43
    I've deleted everything but the table, form and module and after I zipped it its still comming up as 559kb.

  5. #20
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    1. Is the Table large?
    If so, can you strip all but like maybe 25 records?

    2. Try zipping the file.

  6. #21
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43

    upload finaly worked

    got the zip to finally upload. Its the bare bones of everything.

  7. #22
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Ok. I'm looking at it now. I'll get back with you.

  8. #23
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Change your db.Execute statement to this:

    Code:
     
    db.Execute ("UPDATE [mtb-STAT3AR1] SET [mtb-STAT3AR1].[YearField] = " & Me.StrYear & " WHERE [mtb-STAT3AR1].[YearField] Is Null")
    Let me know if that works!

  9. #24
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43
    that worked, Thanks.

    If I want this macro to update the year and period do I just add an addtional line and chang the [yearField] to [Period]? see example below.

    Option Compare Database
    Private Sub cmdUpdate_Click()

    Dim db As Database

    Set db = CurrentDb

    db.Execute ("UPDATE [mtb-STAT3AR1] SET [mtb-STAT3AR1].[Year] = " & Me.StrYear & " WHERE [mtb-STAT3AR1].[Year] Is Null")

    db.Execute ("UPDATE [mtb-STAT3AR1] SET [mtb-STAT3AR1].[Period] = " & Me.StrPeriod & " WHERE [mtb-STAT3AR1].[Period] Is Null")

    End Sub

  10. #25
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You can do it that way or -
    if both year AND period are always going to be either Null or Not Null -
    kill both birds with one stone:
    Code:
     
    db.Execute ("UPDATE [mtb-STAT3AR1] SET [mtb-STAT3AR1].[Year] = " & Me.StrYear & "," & "[mtb-STAT3AR1].[Period] = " & Me.StrPeriod & " WHERE [mtb-STAT3AR1].[Year] Is Null")
    ** I have not tested the above code.

    Is it possible that some records will have a year but no period . . . and vice versa?

    If so - you can write a nested If Then Else statement to check which of the two are Null and then accordingly either update the one that is Null - or update both . . .

    ??

  11. #26
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43
    This worked great. The way the data is imported, both fields will always be null. But I think I've got some other data that may need to utilize the nested if Then Else statement.

  12. #27
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Happy to help!

    Mark the thread Solved if you think it has been solved.

    Let me know if you need more help.
    Post a reply here if you have any other questions.
    Or - you can just start a new thread!!

    All the best!

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

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2013, 11:42 AM
  2. Replies: 1
    Last Post: 03-21-2011, 06:01 AM
  3. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  4. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  5. Replies: 1
    Last Post: 08-04-2008, 03:30 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