Results 1 to 2 of 2
  1. #1
    gameemaster is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    23

    Post Compare Fields Then Produce a MsgBox


    I wanna compare a numeric value (value#1) in a table to another numeric value (value#2) in a query. Value#2 is a calculated field in a query produced by an expression that won't let me input it at the table level.

    IF value#1 is greater than or less than value#2, I would like a message box to appear notifying me of the values.

    Any ideas?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Perhaps you can display both of the values you wish to compare in a form by binding a TextBox Control to each of the two fields.

    If you have two TextBox Controls and you want to compare their Value property, you can do so using VBA. It would look something like ...
    Code:
    if me.ControlName1.Value = me.ControlName2.Value then
    msgbox "They are equal."
    else
    msgbox "NOT equal."
    end if

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

Similar Threads

  1. Replies: 5
    Last Post: 09-30-2015, 04:28 PM
  2. Replies: 10
    Last Post: 03-05-2015, 07:33 PM
  3. Replies: 11
    Last Post: 08-25-2012, 12:36 PM
  4. Replies: 1
    Last Post: 12-21-2010, 09:27 AM
  5. Compare two fields!
    By finditsol in forum Forms
    Replies: 1
    Last Post: 02-11-2010, 01:43 PM

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