Using: Access 2k3
What I have is an input form for inserting inventory (type, amount, price, etc.)
I use an append query to place each type in to another table. If the object is already in the table i'd like to be able to use an update query just to update the values.
The query would be set off by a command button.
I imagine the code is something like:
If [Forms]![Formiteminput]![flditemtype] = tblItemstock Then
stDocName = "qryupdateitem"
Else stDocName = "qryappenditem"
End If
DoCmd.OpenQuery stDocName, acNormal, acEdit
But I don't know quite how to turn this into appropriate visual basic code. Any help will be appreciated.
Thanks.
ConfusedA
What I have is an input form for inserting inventory (type, amount, price, etc.)
I use an append query to place each type in to another table. If the object is already in the table i'd like to be able to use an update query just to update the values.
The query would be set off by a command button.
I imagine the code is something like:
If [Forms]![Formiteminput]![flditemtype] = tblItemstock Then
stDocName = "qryupdateitem"
Else stDocName = "qryappenditem"
End If
DoCmd.OpenQuery stDocName, acNormal, acEdit
But I don't know quite how to turn this into appropriate visual basic code. Any help will be appreciated.
Thanks.
ConfusedA