PDA

View Full Version : Solved: Simple problem I think



crender2000
06-27-2012, 04:35 PM
I have a user form with some comboboxes that is populated from a query. These comboboxes are set as required field. This all works fine the user picks from the drop downs and all the fields are written to a table in access.

Here is my problem. There are going to be times when the user has some thing new that is not in the querry. I have a radio button on the form. I need them to be able to click the radio button and skip the querry . How do I write a value to the comboboxes if the radio buttun is checked. I know how to write to a cell in excell but have no idea in access. I can write fairly well vba in excell but have no experience in accesss.

stanl
06-30-2012, 07:13 AM
These comboboxes are set as required field.

Seems like a cart-before-the-horse situation. If the fields are required, I would assume they are there to validate data that is inserted into a table.

So the issue, at least based on my experience, is not so much overriding the query but adding additional valid choices to the comboboxes. In which case you will need to add controls to your form to perfom that. One way I used to do this was to have a hidden edit control behind each combo, then a button that hides the combo, allows entry into the edit, inserts that data into the lookup table that is behind the combo, performs a requery, then hides/unhides....

I used this method in a situation where there was a drop-down to select Products, and allowed adding a new product to the drop-down on the fly. (which involved a little more coding).

just .02