06-25-14, 07:45 #1Registered User
- Join Date
- May 2014
Unanswered: Access Problem Reading SQL Server Database
Front End: MS Access 2010
Back End: SQL Server 2008
I want to write in Access VBA code a routine that will add to the database an Employee table with a Skills table associated with it (one to many relationship). I have done this many times in Access but not in VBA. The add routine for Employee is complete. What I am having problems with is the Skills. For example to add the records:
zSQL = _
"INSERT INTO [dbo_Employee] " & _
"(employee, position)" & _
" VALUES(" & _
"'" & Remployee & "'" & _
", '" & Rposition & "')"
This adds the Employee. How do I add the Skills?
SkillID int <-- primary key
EmployeeID int <-- FK Skill to Employee
Any help will be appreciated.
06-25-14, 07:52 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
i reckon there shoudl be a table for employees
a table for skills ONLY
a table for employees skills (and intersection table which identifies what skills an employee has and anythign else pertinent to that association (eg date take, assessment and so on
do an insert for each employee skill pairing
presumably you'd have a combo box on your form which identifies the skills available, the suer selects which skill/skills apply then your writ ethe data.
I wouldn't expect you to be writing to the skills table from the empoyeees form
if you are being smart about the combo box, you could requery the row source for the combo box displaying only those skills which the employee doesn't already have (by joining the intersection table to the skills table.I'd rather be riding on the Tiger 800 or the Norton