Results 1 to 4 of 4
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Matching A Value

    Hi


    i want to match a textbox value with value in table, if the textbox value matches the table value then update the data else popup a message box "value not matched"

    Ex:
    If(Me.Text10 != tblUser.ID) Then
    MsgBox "Value Not Matched"
    Else


    Updatequery


    i tried above but not working. how to do this part?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Code:
    If Me.Text10 = tblUser.ID Then
       Updatequery
    Else
         MsgBox "Value Not Matched"
    end if

  3. #3
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    HI


    tried the above code, but not working. i tried below code as well.

    Code:
    Dim Ic As String
    
    Ic = DLookup("NIC", "tblUser", "ID = " & Me.UserLogin)
    
    If (Me.Text10.Value <> Ic) Then
     MsgBox "Please Enter Correct NIC Number" 
    Else 
     Update Query

    is the above code correct?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Can you step back and tell us in plain English what you are trying to accomplish?

    Clarify UserLogin, ID??

    The syntax for If statement
    Code:
    If (some condition) Then
    'if true stuff here
    else
    'if false stuff here
    End IF

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

Similar Threads

  1. Replies: 6
    Last Post: 01-03-2021, 05:06 AM
  2. Replies: 6
    Last Post: 04-08-2018, 03:45 AM
  3. Replies: 1
    Last Post: 10-24-2011, 08:01 AM
  4. Replies: 1
    Last Post: 08-11-2011, 11:33 AM
  5. String Matching
    By tuna in forum Programming
    Replies: 1
    Last Post: 05-16-2010, 12:22 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