Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox on Subform 1

Status
Not open for further replies.

jrl237

IS-IT--Management
Joined
Jan 29, 2002
Messages
61
Location
US
I'm old to Access. I used it years ago, but haven't used it lately. I've just inherited an old Access project, and I'm very rusty. Forgive me if this is a stupid question.

Here's my problem. I have a subform that is loaded from a query. It shows multiple records on separate lines. Each record has a combobox that is populated from another query. This combobox isn't bound to anything. It's just a lookup to provide the user with a list of available values. The combobox actually updates a hidden textbox which is bound to the DB.

Everything populates great, and the form even updates the DB correctly. The problem is, when a selection is made in one combobox, the comboboxes for the other records change with it. It doesn't affect the data in those records, but it looks freaky.

Anyone have any ideas? Any/all help greatly appreciated.

jrl237

 
Yes, AND there is a simple solution.

You subform is set to "Continuous" view rather than single record view - so you get multiple records in rows.
Any object that is not bound to a control in a Continuous view form is simply a duplicate of the same object so a change to one means a change to all.

The solution is to get the combo to blank as soon as it has done its work
It obviously has an Event Procudure attached to it ( probobly its AfterUpdate event.
Go to that code and in the last line insert
cboControlName = Null

where cboControlName is the name of the combobox control.


If you need more help doing that - post back where you're up to.


'ope-that-'elps.




G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Thanks LittleSmudge, that was simple and I got it to work.

Now, is there a way to make the combobox only show up on the New Record line?
 
No - but .. ..

I have used a layout whereby you put the "New Record" line in the Form Header section of the form and all the repeated record controls are in the main body of the form.

The controls in the header can then be the only ones editable and things like the combo box can be completely missing in the detail section.


'ope-that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top