Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Dec 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Preventing Duplicate Entries in Continuous subform

    Hi everyone,

    i have a main form named BillDataMov_F these form containing subform named itemMov_FT it's a continuous form, what i want is when the user enter items in the continuous subform the items not duplicated, what i mean that if the user enter item which is entered before the code check the previous txtbox in the same form if the user entered item msgbox appear "the item is entered before".
    i use these code but the code is wrong becuse the msgbox is appear whenever i enter a value greater than 0

    If DCount("item_no_IM", "BillDataMov", "item_no_IM = " & item_no_IM) >0 Then
    MsgBox "the item is entered in the above txtbox"
    Cancel = True
    End If

    please help

    Regards

  2. #2
    Star Lounger
    Join Date
    Jul 2013
    Location
    Murphy, NC
    Posts
    64
    Thanks
    0
    Thanked 8 Times in 8 Posts
    Hi simsima,
    Welcome to the forum.

    Just to be sure the problem is clear, could you confirm which of the following scenarios (each starting from a "clean slate") trigger the msgbox.

    A. item_no_IM 0 followed by item_no_IM 0
    B. item_no_IM 0 followed by item_no_IM 1
    C. item_no_IM 1 followed by item_no_IM 0
    D. item_no_IM 1 followed by item_no_IM 1

    Dave

  3. #3
    New Lounger
    Join Date
    Dec 2015
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi sir,

    thank you for your help i solve it

  4. #4
    Star Lounger
    Join Date
    Jul 2013
    Location
    Murphy, NC
    Posts
    64
    Thanks
    0
    Thanked 8 Times in 8 Posts
    That's great. Would you like to share your solution here, in case someone else encounters the problem and looks in this thread for help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •