Rick Stanich
King and Supreme Ruler
- Local time
- Today, 08:06
- Joined
- May 13, 2009
- Messages
- 93
The snippet of code below should add a new line to the table "tblPartRev" but it doesnt. I think it has to do with a foriegn key in that table.
The table: tblPartRev
pkPartRevID
fkPartID
txtRev
I have tried to find examples using foriegn keys but have been unsuccesfull.
I am able to add new to another table:
Allthough it doesnt have a foriegn key.
Any hints, tips or examples are appreciated.
The table: tblPartRev
pkPartRevID
fkPartID
txtRev
Code:
myrecset1.Open "tblPartRev", , adOpenDynamic, adLockOptimistic
With myrecset1
.AddNew
'add foriegn key here?
!txtRev = myrev
.Update
.Close
End With
Set myrecset1 = Nothing
I have tried to find examples using foriegn keys but have been unsuccesfull.
I am able to add new to another table:
Code:
myrecset1.Open "tblParts", , adOpenDynamic, adLockOptimistic
With myrecset1
.AddNew
!txtPartNo = mypart
holdPartIDpk = !pkPartID
.Update
.Close
End With
Set myrecset1 = Nothing
Any hints, tips or examples are appreciated.