How to place inserted values from one field to another based on selected combo box values in a different form

Mainman

New member
Local time
Today, 22:11
Joined
Dec 14, 2021
Messages
9
I have created a combo box in a form. The user can select two options. If a specific option is selected, values earlier inserted in a specific field of a different form should be automatically removed there and inserted in the column which is selected in the other form. Does anybody know how to achieve this in MS Access? I am a total beginner at VBA code. Would it be an idea to create an event procedure on change where I update the fields in the first form based on the selection of the combo box?
 
Hi. Welcome to AWF!

If the other form is still open, you can manipulate it from the current form. Otherwise, you could use an UPDATE query to change the data in the underlying table.
 
Hi, Thanks! The first form would still be open when the box value would be inserted so any update would just show immediatly within access(the underlying database is in SQL. The access forms allow for data entry in SQL). Would adding code in the change part within the event procedure of the combo box be a good start?
 
cross posted

@Mainman, maybe read
 
Ok thx for pointing that out. I'll continue here then. I'll attempt to issue a change event which will update it in the SQL query and see if that'll work.
 
can you not have the combo on Same form (form1)?

it would be easier to code on same form rather than on two forms.
if you are in Edit mode on the first form, you need to either save the changes first
or cancel the changes and go on and apply the changes from the combobox.
 

Users who are viewing this thread

Back
Top Bottom