Page 3 of 6 FirstFirst 123456 LastLast
Results 31 to 45 of 86
  1. #31
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    Hmm.. ohh. can do that? how? i dont know..

  2. #32
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931

    Tackling Duplicates

    Observe the code below carefully. This will offer you a check protocol before your user enter data from the universal Form. The code is already embedded in the OnClick Event of Enter Data Button.

    I have Included two more variables
    Dim intCodeID
    Dim strMsg

    What I have done is a Simple DCount to Check if any Record with the value type is present. Rest of the code self explanatory. Remember you have to make adjustmen to all Cases of Select frmDataSource.


    Dim strSQL As String
    Dim strUpdateSQL As String
    Dim intCodeID As Integer
    Dim strMsg As String
    If IsNull(Me.frmDataSource) Then
    MsgBox "Please Select a datasource", vbInformation, "Select Data source"
    ElseIf IsNull(Me.Text10) Then
    MsgBox "Type Data in the Data Text Box"
    Else
    Select Case Me.frmDataSource

    Case Is = 1
    intCodeID = IIf(IsNull(DCount("[client_id]", "tblClient", "[client_name]=" & "'" & Me.Text10 & "'")), 0, DCount("[client_id]", "tblClient", "[client_name]=" & "'" & Me.Text10 & "'"))
    If intCodeID >= 1 Then
    strMsg = MsgBox("There Data might be present please check before insert. Click Yes to Continue and No to Abort", vbInformation + vbYesNo)

    Select Case strMsg

    Case vbYes

    strUpdateSQL = "INSERT INTO tblClient(client_name) VALUES('"
    strUpdateSQL = strUpdateSQL & Me.Text10 & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL strUpdateSQL
    DoCmd.SetWarnings True
    strSQL = "SELECT * FROM tblClient"
    Me.List0.RowSourceType = "Table/Query"
    Me.List0.RowSource = strSQL
    Case vbNo
    MsgBox "Aborted"
    End Select
    Else
    strUpdateSQL = "INSERT INTO tblClient(client_name) VALUES('"
    strUpdateSQL = strUpdateSQL & Me.Text10 & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL strUpdateSQL
    DoCmd.SetWarnings True
    strSQL = "SELECT * FROM tblClient"
    Me.List0.RowSourceType = "Table/Query"
    Me.List0.RowSource = strSQL

    End If

  3. #33
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Did you try out the check duplicate

  4. #34
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    i just read ur reply.. still check on it.. thank you so much,...

  5. #35
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    as u can see, i add another field in my project table. it is because the user want to type the id by themself. n also they want to let say key in the id in the maintainance form n all the details about the project will appear. can do that by access?

  6. #36
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    maximus, why the update form for all the record still does not appear with all the data. it still blank like the new form

  7. #37
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    ive checked the code. the acformedit and acformadd.
    sometimes the data will all appear both in updating(all record) and updating (new record), but sometimes both will blank

  8. #38
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    I checked out the daatabase that I designed and if you still have it the Update Project all Record is working just Fine have you changed any thing. zip and send me your db let me see the problem.

  9. #39
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    nope. i didnt change anything. just ive add the main menu command button to the form. so then the user can back to main menu after fill up the form..

  10. #40
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    here is my db

  11. #41
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    then send me the mdb let me check.

  12. #42
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    already sent it

  13. #43
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    check it now

  14. #44
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    did you try it out

  15. #45
    ngeng4 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    93
    juz came back from my lunch hr. thanx maximus..

Page 3 of 6 FirstFirst 123456 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error Message in Access2007
    By Storm91 in forum Access
    Replies: 3
    Last Post: 02-18-2010, 02:56 PM
  2. Text too long, error message
    By taylormotm in forum Access
    Replies: 13
    Last Post: 06-18-2009, 07:24 PM
  3. where do i start with this error message?
    By Student4Life in forum Access
    Replies: 0
    Last Post: 01-09-2009, 04:12 PM
  4. FROM Clause error message
    By skylite in forum Queries
    Replies: 2
    Last Post: 10-23-2008, 05:47 AM
  5. If / Then Error Message
    By Schwagr in forum Forms
    Replies: 4
    Last Post: 03-30-2006, 06:28 AM

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