0
votes

I just learned Ms Access for about 2 weeks, so pardon me if I missed some basic things. Currently I have a continuous form containing combo boxes which connect to my tblMain table. This table only has two fields:

  1. Category : which used as 'label' for each combo boxes;
  2. IsSelected: used as Control Source for the combo boxes, which returns to Yes orNo depending on whenever it's corresponding combo box is ticked or not.

This system worked just fine. However, I want to tweak it a little bit. Everytime I ticked on a combo box, the value on IsSelected field will not update until I click another combo box (or another label). Is this how combo boxes work? Can I set it so it will update the value just after combo box is ticked, without having to click on another box or label?

I plan to add a button on the form's footer to append every ticked record to another table. That's why I want to prevent a record not appended when I forgot to click on another row.

1
Where is the code that sets value of IsSelected? Edit question to show. Is this a multi-user database?June7
I am not using VBA code to fill IsSelected field. Just set it's Data Type as Yes/No from Design View, then create a combo box and set combo box's Control Source linked to this field. Anyway, this is an access desktop database and only 1 user (me) who manage it.Usman H.
Sorry, I misread post, thought there was a checkbox and a combobox. No field for any bound control will update until focus leaves that control. Record is committed to table when: 1) close table/query/form; or 2) move to another record; or 3) run code to save.June7
It's not the way that comboboxes work, it's the way that forms work. As long as you don't click on another record (you comboboxes all belong to different records) or close the form, the changed record isn't saved. You should be able to see that on the record selector left of each record.Wolfgang Kais
Wow! You guys are life saver.. Thanks for your explanation..Usman H.

1 Answers

0
votes

Awesome! Thanks June7 and Wolfgang Kais for pointing out how a form write it's value into a field.

I managed to solve my problem by adding a Do.Cmd.RunCommand acCmdSaveRecord line into my button just before it executes insert/append command. It does the job exactly as I wanted!