Results 1 to 2 of 2
  1. #1
    AccessPro is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2022
    Posts
    1

    iif in query

    I'd like to write an if statement where a parameter result updates a field. I will try to explain:

    if ([would you like to update the field?] == "yes") then it updates it.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    you dont ask this in the query. do it in code:

    if msgbox("Update the field",vbyesNo,"confirm") = vbYes then docmd.openquery "quUpdQry"


    ...unless you are actually updating that field to yes/no or other:
    update table set [yesNoFld]= [Update this field]

    then the field will get the reply the user enters.

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

Tags for this Thread

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