Results 1 to 5 of 5
  1. #1
    TrulyVisceral is offline Total N00B
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Deimos
    Posts
    102

    Unhappy Create a button that runs an Update query

    Just a query to update all Null fields in one column of the entries to "false", cause that's how they're normally entered, either true or false (not a check box or smth). That's how the main app saves it's data, but dunno, maybe the operator made a mistake or smth.



    Button is called "UpdateButton", query is called "QRYUpdateIncExt". I tried the vbYesNo command but...

    Sorry, it's just I'm still not used to making pop up windows.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Either

    CurrentDb.Execute "QRYUpdateIncExt", dbFailOnError

    or

    DoCmd.OpenQuery "
    QRYUpdateIncExt"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    What 'main app'? Are you importing data? Is this a text field you want to save true or false as text not Boolean?

    Exactly what is issue - error message, wrong result, nothing happens? Post SQL statement.
    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. #4
    TrulyVisceral is offline Total N00B
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Deimos
    Posts
    102
    Quote Originally Posted by pbaldy View Post
    Code
    Thanks. I figured out the vbYesNo as well.

    Also, June7, it's the HP Service Desk. And it's just a text field.

    The code goes as follows:
    Code:
    Private Sub UpdateButton_Click()
    Dim msg As String, button As Variant, title As String, response As Variant
    msg = "Continue?"
    button = vbYesNo + vbDefaultButton2
    title = "Warning"
    
    
    response = MsgBox(msg, button, title)
    If response = vbYes Then
      CurrentDb.Execute "QRYPresUpdateIncExt", dbFailOnError
    Else
      'Left blank on purpose
    End If
    End Sub
    The problem is that I made the graphs check only "true" and "false", those that are Null aren't noticed. (senpai!!!!)
    Normally they'd be saved as either value, but sometimes in the transfer the value goes blank (I think that's what happens, no one I've asked is quite sure, and I haven't asked the Operators themselves, so whatevs)

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by TrulyVisceral View Post
    Thanks. I figured out the vbYesNo as well.
    No problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 10-25-2017, 02:41 PM
  2. Search Button that runs two queries
    By WesHarding in forum Queries
    Replies: 2
    Last Post: 02-23-2017, 12:53 PM
  3. ADOB - Update runs very slow
    By fluffyvampirekitten in forum Access
    Replies: 2
    Last Post: 01-31-2016, 07:59 PM
  4. Replies: 4
    Last Post: 07-17-2015, 09:11 PM
  5. Replies: 2
    Last Post: 11-19-2012, 03:23 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