Oct 19 2011, 10:36 AM
I have a continuous subform on my main form that is filtered depending on the value of a combobox (though link master fields and link child fields). I've put a Me.subformControl.Requery in the AfterUpdate of the combobox. However, only the "new"(blank) record in the subform changes to reflect the new combobox value. The records related to the old combobox value stay in the subform until I navigate to a new mainform record or I requery the main form (which I don't want to do since it sends me back to the first record). Am I missing something obvious?
Thanks in advance,
Oct 19 2011, 11:23 AM
Would it be possible to zip and attach your db?
If you have sensitive data, make a copy of your db,
remove or replace it with dummy data,
Compact and repair --then zip and attach.
Might be easier if we could actually see the behavior in action
Oct 19 2011, 11:31 AM
i think it must be something to do with the way you are linking the form to the subform. is the combo box unbound by any chance?
Oct 19 2011, 12:27 PM
No, the combobox is bound to the main form. I'll attach the database when I get to work tomorrow, thanks!
Oct 19 2011, 12:51 PM
Will look forward to seeing it.
Oct 20 2011, 02:13 AM
ok. Here it is.
The split form in question is "frmPlasmidsSplit" The subform that isn't loading is the sfrBackboneResistance that is bound to a junction table between backbone and resistance. I put an extra column in there for troubleshooting. The first column is the backbone ID, the second is the resistance (right now either Ampicillin or Kanamycin). The backbone is controlled by the cboBackbone control on the main page. What I want to happen is when you change the value of backbone, only the resistances associated with that backbone should appear in the subform: pFU_W (1) = Ampicillin, pCAG(2) = Kanamycin. Now, when you toggle it, the greyed out subform record changes backboneID, but the existing white record does not reflect the new backboneID.
Thanks again for the help.
Oct 20 2011, 04:01 AM
So I reverted to another copy of the database (that was originally trapped in a record until I figured out how to debug it) and now it works. I do not know why, but I'm not one to look a gift horse in the mouth. Thanks for the help everyone!
Oct 20 2011, 05:19 AM
Glad you found a solution!
Good luck with your project
Oct 20 2011, 05:50 AM
alas, it's happening again. That's the problem with magical solutions
Oct 20 2011, 06:12 AM
ok, here it is again.
Oct 20 2011, 06:30 AM
Several issues I didn't mention earlier because it seemed you had solved your issue:
you need to add Option Explicit
under Option Compare Database:Option Compare Database
Check your cbo's Not In List Events--
One of them needs: Dim strTemp as String
I think it was cboBackbones
Using Fields Captions at the Table level isn't recommended.
It might work if you and only you will ever need to see
the inner workings of your db--
however more times than not, using Captions will cause you headaches
down the road.
It is difficult for me to try to look for what is causing the current issue,
because of the use of the captions.
And I'm still not clear on what you want to happen in the split form.
Oct 20 2011, 07:15 AM
Thansk for your tips cpetermann,
Right, I did add option explicit, but that was after I had uploaded the first database, and I hadn't gotten around to fixing the second one yet.
I did catch the missing variable declaration and I'll fix the captions.
What I want is when I change the value of cboBackbone, the subform display the antibiotics bound to that backbone. In this specific example, when I change from FU_W to pCAG, the subform should go from displaying Kanamycin to Ampicillin immediately and not just when I change records.
Oct 20 2011, 07:33 AM
ok. I think I got all your comments
Oct 20 2011, 10:23 AM
in the AfterUpdate Event
Add after the End If
See if this does what you need it to do.
Oct 20 2011, 10:16 PM
That successfully requeries the subform, but since it requeries the page, it also sends me back to the first record (which is an unwanted behaviour).
Oct 21 2011, 04:13 AM
Created a new subform for selecting Backbone
& Backbone Resistance
Give it a try and see if this works for you.
Oct 21 2011, 05:00 AM
Thanks for that, I never thought about putting the cboBackbone on the subform. There might be a problem with the fact that cboBackbone needs to trigger changes on the main form, but I can access those controls through a .Parent or Forms!Mainform reference, right? Hopefully I can make this work.
Thanks again for the help,
Oct 21 2011, 05:02 AM
I hope it works for you.
Good luck with your project
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here