Click here to Skip to main content
15,867,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.

My problem is...
I have Access database. and I create access forms to add data to the tables.
In my case table1 have combobox. This combobox contain two value (IN, OUT)

If we select combobox value as IN then I need to update table2 column value.

how can i do this using macro or VBA...

Thanks..
Posted

1 solution

There are two general ways to achieve this. One is to bind the data to your form, the other is to use a SQL statement (whether that's by query or hand coded) called from an event behind the form, say the on click event of a Process button or something similar...
 
Share this answer
 
Comments
Soft009 11-Aug-11 2:46am    
can you give me small example.... I try to do it in on click event but not sucess.... i cant call that method.. it produce an error..
_Damian S_ 15-Aug-11 21:59pm    
Inside the On Click event, you could use something similar to the following:

docmd.runsql "Update TABLE2 set FIELDNAME = " & me.COMBONAME & " where FIELDID = " & me.FIELDID

Clearly you need to use correct field and table names, and this assumes you have some kind of identifier to do this...

What are you actually trying to achieve, as this does seem a little convoluted...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900