Results 1 to 7 of 7
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Smile Pop Up window to prompt user!

    I have a form with a subform. I want to look at the items user has entered and if certain items are present.....pop-up window saying "Please run XXXX cycle".

    This would be best served on the click event of the "save & close" btn of the form. What I dont know is how to accomplish this....

    Can I run a query and then if query has any results.....MsgBox?

    How about DLookup?


    Sorry, I have searched through this forum and the web but found nothing similar....

    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,824
    The 'Save & Close' btn is on the main form? You want to look at items entered into the subform?

    DLookup is a possibility.

    If Not IsNull(DLookup("fieldname", "tablename", "fieldname=" & some criteria here)) Then MsgBox "Please run XXXX cycle."
    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.

  3. #3
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Thanks for replying June7....

    I have this in the click event on the main form ....
    If Not IsNull(DLookup("ImplantSetID", "tblLoadDetails", "LoadID = " & Forms!frmLoad![LoadID])) Then MsgBox "Implants - Use 270 deg - 35 min Cycle"
    End If


    I am getting error..... End If without Block If ?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,824
    The If Then is a one-liner, don't need End If.
    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.

  5. #5
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Thanks, just figured that out.....deleted end if and now......

    syntax error (missing operator) in query expression 'LoadID = '

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Either use this

    Code:
    If Not IsNull(DLookup("ImplantSetID", "tblLoadDetails", "LoadID = " & Forms!frmLoad![LoadID])) Then 
     MsgBox "Implants - Use 270 deg - 35 min Cycle"
    End If
    Or place all of the code on a single line, omitting the final End If)

    Either will work, but not half one and half another, as your code shows.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,824
    LoadID is a number field type? The main form is frmLoad?

    I don't see anything wrong with the expression, unless LoadID is text then need apostrophe delimiters for the criteria.
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-05-2012, 02:34 AM
  2. Replies: 1
    Last Post: 02-01-2012, 11:27 PM
  3. User Prompt for multiple Files
    By ratherbgolfing in forum Programming
    Replies: 1
    Last Post: 01-31-2012, 03:38 PM
  4. Prompt User for Date Range when running QUERY
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 01-30-2012, 11:49 AM
  5. Replies: 13
    Last Post: 07-27-2011, 12:38 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