Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 4th, 2006, 03:29 PM
Registered User
 
Join Date: Apr 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please Help! Ms Access Data Access Pages

The following query is updating the record instead of inserting a new one. Please help.

<SCRIPT language=vbscript event=onclick for=cmdSave>
<!--
    On Error Resume Next
    Dim strSrc, strSQL, cat1, cmd1, result1

    set strSrc = CreateObject("ADODB.Connection")
    strSrc.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=\\intraweb\ProjectTracking$\ProjectTracking .mdb;"

    TrackingSeq.value = TrackingSeq.value + 1
If TrackingSeq.value <> 1 Then
    strSQL = "INSERT INTO Tracking " & _
    "(TrackingID, TrackingSeq, ProjectID, ProjectName, Department, " & _
    "DeptHead, DeptHeadPhone, ProjectManager, ManagerPhone, Priority, Status, " & _
    "PercentComplete, Issues, NextSteps, ReportDate, AchievementLevel, " & _
    "WarrantyPeriod, ProjectDescription, Milestone1, Milestone2, Milestone3, " & _
    "Milestone4, Milestone5, Milestone6, Milestone7, Milestone8, Milestone9, " & _
    "Milestone10, MilestoneStatus1, MilestoneStatus2, MilestoneStatus3, " & _
    "MilestoneStatus4, MilestoneStatus5, MilestoneStatus6, MilestoneStatus7, " & _
    "MilestoneStatus8, MilestoneStatus9, MilestoneStatus10, " & _
    "MilestoneDueDate1, MilestoneDueDate2, MilestoneDueDate3, " & _
    "MilestoneDueDate4, MilestoneDueDate5, MilestoneDueDate6, " & _
    "MilestoneDueDate7, MilestoneDueDate8, MilestoneDueDate9, " & _
    "MilestoneDueDate10, MilestoneStatDesc1, MilestoneStatDesc2, " & _
    "MilestoneStatDesc3, MilestoneStatDesc4, MilestoneStatDesc5, " & _
    "MilestoneStatDesc6, MilestoneStatDesc7, MilestoneStatDesc8, " & _
    "MilestoneStatDesc9, MilestoneStatDesc10 ) " & _
    "SELECT TrackingID.value, TrackingSeq.value, ProjectID.value, ProjectName.value, " & _
    "Department.value, DeptHead.value, DeptHeadPhone.value, " & _
    "ProjectManager.value, ManagerPhone.value, Priority.value, Status.value, " & _
    "PercentComplete.value, Issues.value, NextSteps.value, " & _
    "ReportDate.value, AchievementLevel.value, " & _
    "WarrantyPeriod.value, ProjectDescription.value, Milestone1.value, " & _
    "Milestone2.value, Milestone3.value, Milestone4.value, " & _
    "Milestone5.value, Milestone6.value, Milestone7.value, " & _
    "Milestone8.value, Milestone9.value, Milestone10.value, " & _
    "MilestoneStatus1.value, MilestoneStatus2.value, MilestoneStatus3.value, " & _
    "MilestoneStatus4.value, MilestoneStatus5.value, MilestoneStatus6.value, " & _
    "MilestoneStatus7.value, MilestoneStatus8.value, MilestoneStatus9.value, " & _
    "MilestoneStatus10.value, MilestoneDueDate1.value, " & _
    "MilestoneDueDate2.value, MilestoneDueDate3.value, " & _
    "MilestoneDueDate4.value, MilestoneDueDate5.value, " & _
    "MilestoneDueDate6.value, MilestoneDueDate7.value, " & _
    "MilestoneDueDate8.value, MilestoneDueDate9.value, " & _
    "MilestoneDueDate10.value, MilestoneStatDesc1.value, " & _
    "MilestoneStatDesc2.value, MilestoneStatDesc3.value, " & _
    "MilestoneStatDesc4.value, MilestoneStatDesc5.value, " & _
    "MilestoneStatDesc6.value, MilestoneStatDesc7.value, " & _
    "MilestoneStatDesc8.value, MilestoneStatDesc9.value, MilestoneStatDesc10.value " & _
    "FROM Tracking;"
End If
    MSODSC.Connection.Execute strSQL

-->
</SCRIPT>






Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access: Data Access Page sevp95 Access VBA 0 July 14th, 2008 11:07 AM
MS Data Grid control in ms access application roshla_p Access VBA 5 October 16th, 2006 02:37 AM
Data Access Pages Surfingeurope Access VBA 0 January 30th, 2006 01:01 PM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM
MS Access Pages zmark Access 0 September 21st, 2004 08:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.