If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Help with using a form in Access that inserts data into Oracle....

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-09, 20:26
sarahmiller sarahmiller is offline
Registered User
 
Join Date: Dec 2009
Posts: 5
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?
Reply With Quote
  #2 (permalink)  
Old 12-05-09, 21:21
pbaldy pbaldy is offline
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 2,475
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
Reply With Quote
  #3 (permalink)  
Old 12-05-09, 21:44
sarahmiller sarahmiller is offline
Registered User
 
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?
Reply With Quote
  #4 (permalink)  
Old 12-06-09, 00:22
pbaldy pbaldy is offline
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 2,475
I'm not really clear on what you're asking. Can you elaborate?

Welcome to the site by the way.
__________________
Paul
Reply With Quote
Reply

Tags
access, form, odbc, oracle, sql

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On