View Poll Results: need answer

Voters
1. You may not vote on this poll
  • help

    0 0%
  • queton need

    1 100.00%
Multiple Choice Poll.
Results 1 to 11 of 11
  1. #1
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    Unhappy Diplcate recorder display in form when update-is that difficult

    Hi,
    Friend I need ur help?is my question is difficlut.
    I have database , I am enter info,(first name and second name)
    my question



    -when I put first name and second name and it will check if that first and second name been entered before massgae box appear and show all related info.

    see attched file my database

    -wish i get solution for my question

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I do not understand your question

    Are you trying to check to see if a first name/last name combination has been entered in your database before? Why would you want to prevent that from happening? What if you have two people with the same name?

  3. #3
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    prevent same name

    Hi,
    Yes i want to prevent peoples with same name,yes ur correct two poples with same name ,that way massage box will appear ,i will see it if it same i will just canael enter if not same plz must give option as new record

    thx for u help

  4. #4
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    it's quit common practice to warn when a double name has been entered. But as rpeare said, I wouldn't undo the entry, just pop up a warning and give the user the opportunity to view the existing record so they can check if it's the same person or not.
    If you really don't want to allow double names, than put a unique index on the fields firstname + secondname.

    greetings
    NG

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    in the ON EXIT property of your first name and lastname you would have to have something like

    if dcount("[PersonID]", "tblPeople", "[FirstName] = '" & me.firstname & "' and [lastname] = '" & me.lastname & "') > 0 then
    msgbox "That person already exists"
    else
    'perform your append
    endif

  6. #6
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    repear ,u got my need 90%

    Hi repear,
    many thx u answered it 90%,
    if u see my attached file and i am send again,i have fix that,in my database i have sub from ,i want it display i want show info of main from and sub form warn massage box appear i will view with yes and no option
    if i click yes it not same and add as new record


    again i thanks all
    Last edited by miziri; 08-19-2011 at 10:52 AM. Reason: attached file

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Code:
    Dim irecct As Integer
    Dim Response As Integer
    Dim strLinkCriteria As String
    Dim rsc
    
    Set rsc = Me.RecordsetClone
    
    If Me.Dirty = True Then
    
        strLinkCriteria = "[firstname] = '" & Me.firstname & "' AND [secondname] = '" & Me.secondname & "'"
        irecct = DCount("*", "qrymain", strLinkCriteria)
        
        If irecct > 0 Then
            Response = MsgBox("Someone with that name exists.  Continue (YES) or Cancel record and go to existing person (NO)", vbYesNo, "Continue")
            If Response = vbYes Then
            Else
                Me.Undo
                rsc.FindFirst strLinkCriteria
                Me.Bookmark = rsc.Bookmark
            End If
        End If
    End If
    use this code instead, it will prompt you to go to the existing record or continue doing what you're doing

  8. #8
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    see attached file i copy ur paste

    Dear repear
    I hope ur fine i past ur copy with my datbase i hope u try it there error

    plz download it,
    th

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I have no idea what you're trying to say

  10. #10
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    i paste ur copy not wor

    Hi
    i paste ur copy in my file can check or if u can plz copy into my attached database this some error


    our i bagiiner if u have can we chat now

    thx

  11. #11
    miziri is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    80

    Repear ur final feedback

    Dear Repear,
    I hope ur find,I copy ur code,but i did work with manin form but with sub form not work,
    plz i sent in my preious email my database ur copy is copied plz check and fix it,

    thx

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

Similar Threads

  1. Replies: 9
    Last Post: 11-09-2011, 11:34 AM
  2. Replies: 23
    Last Post: 07-29-2011, 04:24 PM
  3. Creating a difficult qry
    By Aubreylc in forum Queries
    Replies: 8
    Last Post: 02-11-2010, 12:13 PM
  4. A Difficult One...(I Think)
    By NickyThorne1 in forum Access
    Replies: 0
    Last Post: 01-31-2009, 07:56 AM
  5. Difficult problem
    By francisca_carv in forum Access
    Replies: 0
    Last Post: 11-19-2008, 05:50 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