Update Record (1 Viewer)

wschian

Registered User.
Local time
Today, 14:23
Joined
Dec 12, 2013
Messages
19
Hello,:):)
I had made a simple access file using update statement but i dont know why can not work,
Example of my table

Grade Code Country
1 X MAL
2 X UK
3 X US
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I want to update my table record as

Grade Code Country
1 X MAL
5 Y UK
3 X US
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

i create a "buttom" with Code Buider and write a following

Private Sub Command0_Click()
Update Orders
SET Grade='5', code='Y'
WHERE County='UK';

End Sub

>>>>>>>>>>>>>>>>>>>

every can help me?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:23
Joined
Aug 30, 2003
Messages
36,139
Well, to do it how you're trying to:

CurrentDb.Execute "Update Orders SET Grade='5', code='Y' WHERE County='UK'"

Which assumes Grade is a text field.
 

wschian

Registered User.
Local time
Today, 14:23
Joined
Dec 12, 2013
Messages
19
THANKS. it work:):)
 

David R

I know a few things...
Local time
Today, 16:23
Joined
Oct 23, 2001
Messages
2,633
Now that we've got it working, WHY are you doing it that way? Class assignment?
 

wschian

Registered User.
Local time
Today, 14:23
Joined
Dec 12, 2013
Messages
19
i want to made a own Point OF Sales (POS) system using access
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:23
Joined
Aug 30, 2003
Messages
36,139
Happy to help, and welcome to the site by the way! As David implies, I doubt a real life db would work that way. I assumed it was a learning exercise.
 

Users who are viewing this thread

Top Bottom