From: K on 18 May 2010 04:03 Hi all, I got table in my database with name "tbldata" and i have two fields in that table with the name "Ticket_No" and "Amount". In "Ticket_No" filed column i have value "SD001" and in same row of "Amount" column i have figure "50". With VBA how can i lookup for value "SD001" in "Ticket_No" field and change figure "50" to "30" which is appearing in same row of "Amount" column field. My other question is that how can i add new record in same table with VBA. I want to put new value "VR004" in "Ticket_No" field column and new figure "20" in same row of "Amount" column. I'll be very greatful if any friend can help me with simple vba code on this.
From: mie via AccessMonster.com on 18 May 2010 04:51 Really simple. You dont even need VBA to do this. Use form wizard, you will get what you want.. K wrote: >Hi all, I got table in my database with name "tbldata" and i have two >fields in that table with the name "Ticket_No" and "Amount". In >"Ticket_No" filed column i have value "SD001" and in same row of >"Amount" column i have figure "50". With VBA how can i lookup for >value "SD001" in "Ticket_No" field and change figure "50" to "30" >which is appearing in same row of "Amount" column field. My other >question is that how can i add new record in same table with VBA. I >want to put new value "VR004" in "Ticket_No" field column and new >figure "20" in same row of "Amount" column. I'll be very greatful if >any friend can help me with simple vba code on this. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201005/1
From: Allen Browne on 18 May 2010 04:54 Two approaches: OpenRecordset, or execute an action query. For an OpenRecordset() example, see: http://allenbrowne.com/func-DAO.html#DAORecordsetExample For an Execute example, see: http://allenbrowne.com/ser-60.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "K" <kamranr1982(a)yahoo.co.uk> wrote in message news:483db18a-2ac2-4cdf-b21c-3ced54df4ed2(a)r9g2000vbk.googlegroups.com... > Hi all, I got table in my database with name "tbldata" and i have two > fields in that table with the name "Ticket_No" and "Amount". In > "Ticket_No" filed column i have value "SD001" and in same row of > "Amount" column i have figure "50". With VBA how can i lookup for > value "SD001" in "Ticket_No" field and change figure "50" to "30" > which is appearing in same row of "Amount" column field. My other > question is that how can i add new record in same table with VBA. I > want to put new value "VR004" in "Ticket_No" field column and new > figure "20" in same row of "Amount" column. I'll be very greatful if > any friend can help me with simple vba code on this.
|
Pages: 1 Prev: Populate date to another Next: Operation not supported in transactions |