PDA

Click to See Complete Forum and Search --> : Appending Database


AcornRanch
Feb 6th, 2000, 08:16 PM
I currently have a database program that when an item number is press that is in the database and tab is pressed the data for that item comes up. (ie. description, cost, etc) What I would like to be able to do is then change the QTY field and have it append the database rather than just write a new record. Any suggestions??

Thanks in advance,

Jeremy

PaulB
Feb 7th, 2000, 02:15 AM
If you just want to edit the field do this

Adodc1.Fields("qty").Value = something
Adodc1.Update

AcornRanch
Feb 7th, 2000, 08:25 AM
This is the code i'm using now. It looks like it should work....

Private Sub cmdEnter_Click()

Dim dbs As Database
Dim inventory As Recordset

Set dbs = OpenDatabase("parts.mdb")
Set inventory = _
dbs.OpenRecordset("Inventory", dbOpenDynaset)

With inventory

.AddNew

!Itemnumber = txtNum.Text
!Description = txtDesc.Text
!Retail = txtRetail.Text
!Wholesale = txtWhole.Text
!Profit = txtProfit.Text
!Company = cmbCompany.Text
!qty = txtQty.Text
!MemoBox = txtMemo.Text
.Update
.Bookmark = .LastModified

End With

cmdClear_Click
End Sub

any ideas? it doens't update the field QTY

Clunietp
Feb 7th, 2000, 11:34 AM
try VAL(txtQty.text)

AcornRanch
Feb 7th, 2000, 08:41 PM
Thanks to everybody for your help. It's working great now!!