Updating Subform Based on Combo Box Selection

No, I think you misread that. It doesn't say anything about the "DescriptionKey" field. It says it can't find "Description Key" field. Which is the control name for the text box in my subform which contains the "DescriptionKey" data.

I am confident that that is the name of the control.


Ok, my bad. I was thinking about this the wrong way. The combobox actually filters two other fields whose control names are Description and Code Definition.

When I made the adjustment (below) I got the error message that "Object does not support property or method." Does this mean that since "DescriptionKey" is a number I should be using a different code to filter?

Code:
     Me![Description].Form.Filter = "[Description Key] = '" & Combo11.Value & "'"
     Me![Description].Form.FilterOn = True
 
SOS: I am aware there can be late binding issues using the bang but for a relatively small database it shouldn't matter much. I tend to use the controls collection too for clarity. By the way, thanks for the rep and comments :)

thabounceisback: I don't remember you saying Description is the name of your control?

Best thing to do now is to zip, upload and post your db and I'll fix it.
 
SOS: I am aware there can be late binding issues using the bang but for a relatively small database it shouldn't matter much.
It's not about the database size. It is about names. And if you use the bang when referring to controls (especially controls that have the same name as their bound fields) you are going to run into trouble. Pat Hartman (former Access MVP and still the top poster on the site) has some good info on Bang vs. Dot if you look for it.
 
Here is the file... I realize now that some of the data is linked to another database. If that causes any problems, let me know.

Otherwise, thanks a lot for your help.
 

Attachments

Access handles the update, but it not immediate like I need it to be. If you change a selection, it will not update the subform until you either exit the form or change records. I need user's to be able to see updates as soon as they change the option in the combo box.

Not correct, if you set it up as it should.


JR
 

Attachments

Just like I thought, you had given me the wrong name for the subform. Use this instead:

Me.Crosswalk_subform.Form.Filter = "[Description Key] = " & Combo11.Value
Me.Crosswalk_subform.Form.FilterOn = True
 
Not correct, if you set it up as it should.


JR
This is exactly what I want.

What steps could i have possibly missed?

The main difference between my db and yours is that your data is all in one table. My data is linked across two tables through a 1 to many relationship. ANy ideas of where I might have screwed up?
 
So all working now then?

I am not really sure what happened when I used your current solution. There were no error messages, and my subform just almost disappeared.

At this point, I am trying to figure out what went wrong when I created the subform in the first place.
 
The main difference between my db and yours is that your data is all in one table. My data is linked across two tables through a 1 to many relationship. ANy ideas of where I might have screwed up?

The only thing I did was to setup the Master/Child relationship on the CustID.

As long as the the tables are related on a common key you can use form/subform. What happen in your case I don't know perhaps you got the linkage backwards?

Keep hunting. :)

JR
 
I am not really sure what happened when I used your current solution. There were no error messages, and my subform just almost disappeared.

At this point, I am trying to figure out what went wrong when I created the subform in the first place.

You linked your subform to your Main form using Description and then you're filtering again using the same field. Remove the Link Master Fields and Link Child Fields from the subform.
 
You linked your subform to your Main form using Description and then you're filtering again using the same field. Remove the Link Master Fields and Link Child Fields property values from the subform.
 
I am not really sure what happened when I used your current solution. There were no error messages, and my subform just almost disappeared.

At this point, I am trying to figure out what went wrong when I created the subform in the first place.

You linked your subform to your Main form using Description and then you're filtering again using the same field. Remove the Link Master Fields and Link Child Fields from the subform.
 

Users who are viewing this thread

Back
Top Bottom