|
-
May 31st, 2002, 12:13 PM
#1
Thread Starter
Hyperactive Member
simple mathematics ans SQL insertion?
Hi there,
I have an access database, and one of the columns is called "Tab" , as in a bar tab (how much a person owes)
On my VB form I have a text box, I want it so the user can enter in an integer in the text box and click a button, and it will ADD this number to the current number in the tab field of the DB.
I dont want the exisiting number in the DB to be overwritten, I want a new total to be created.
Anyone know how to do this?
mANY THANKS
Steven
"The Dude abides...."
-
May 31st, 2002, 01:05 PM
#2
New Member
Well, if I get want you want to do, then something like this:
dim an integer to hold the tab amount, open the recordset and retrieve the current total. Store the current total in the integer you dimmed. Add the text box to the dimmed integer. Your total is now in the dimmed integer. Save that to your recordset.
Or kinda like this:
<code>
dim iTab as Integer
iTab = adoPrimaryRS("tab")
adoPrimaryRS("tab") = adoPrimaryRS("tab") + iTab
adoPrimaryRS.Update
</code>
-
Jun 1st, 2002, 02:02 PM
#3
Lively Member
How are your tables set up?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|