Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    5

    Unanswered: Help with using a form in Access that inserts data into Oracle....

    This is the code I've got so far:

    Private Sub btnAdd_Click()
    Dim strSQL As String

    strSQL = "INSERT INTO HR_Employees(Employee_ID,First_Name,Last… VALUES ('" & Me.txtEmployeeID & "','" & Me.txtFirstName & "','" & Me.txtLastName & "','" & Me.txtEMail & "','" & Me.txtPhoneNumber & "','" & Me.txtHireDate & "','" & Me.txtJobID & "','" & Me.txtSalary & "','" & Me.txtCommission & "','" & Me.txtManagerID & "','" & Me.txtDepartmentID & "');"

    DoCmd****nSQL (strSQL)

    End Sub

    I keep getting an error. The message box says, "You are about to append (1) rows."...Then if I click yes, another message box says it can't append all the records in the append query...What am I doing wrong?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The rest of the error message might help. First thoughts are that it's a key violation, which could either be that you're inserting an employee ID that already exists in a table that doesn't allow duplicates, or a field that doesn't allow Null values isn't being populated.
    Paul

  3. #3
    Join Date
    Dec 2009
    Posts
    5
    Thanks...that fixed it...I actually have another problem now. I'm trying to update the form so that after the data is added, the update button will update the addition and I'll be able to view it from a combo box. How can this be coded?

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I'm not really clear on what you're asking. Can you elaborate?

    Welcome to the site by the way.
    Paul

Tags for this Thread

Posting Permissions

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