My Assistant
![]() ![]() |
|
|
Oct 19 2011, 10:36 AM
Post
#1
|
|
|
UtterAccess Member Posts: 24 |
Hello,
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, Calfaile |
|
|
|
Oct 19 2011, 11:23 AM
Post
#2
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
Calfaile,
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 (IMG:style_emoticons/default/smile.gif) |
|
|
|
Oct 19 2011, 11:31 AM
Post
#3
|
|
|
UtterAccess VIP Posts: 1,903 From: UK |
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
Post
#4
|
|
|
UtterAccess Member Posts: 24 |
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
Post
#5
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
Great!
Will look forward to seeing it. |
|
|
|
Oct 20 2011, 02:13 AM
Post
#6
|
|
|
UtterAccess Member Posts: 24 |
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.
Attached File(s)
|
|
|
|
Oct 20 2011, 04:01 AM
Post
#7
|
|
|
UtterAccess Member Posts: 24 |
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
Post
#8
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
Calfaile,
Glad you found a solution! Good luck with your project (IMG:style_emoticons/default/smile.gif) |
|
|
|
Oct 20 2011, 05:50 AM
Post
#9
|
|
|
UtterAccess Member Posts: 24 |
alas, it's happening again. That's the problem with magical solutions
|
|
|
|
Oct 20 2011, 06:12 AM
Post
#10
|
|
|
UtterAccess Member Posts: 24 |
|
|
|
|
Oct 20 2011, 06:30 AM
Post
#11
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
Calfaile,
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 Option Explicit 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. (IMG:style_emoticons/default/pullhair.gif) 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
Post
#12
|
|
|
UtterAccess Member Posts: 24 |
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. Thanks. |
|
|
|
Oct 20 2011, 07:33 AM
Post
#13
|
|
|
UtterAccess Member Posts: 24 |
ok. I think I got all your comments
Attached File(s)
|
|
|
|
Oct 20 2011, 10:23 AM
Post
#14
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
in the AfterUpdate Event
Add after the End If Me.Requery See if this does what you need it to do. |
|
|
|
Oct 20 2011, 10:16 PM
Post
#15
|
|
|
UtterAccess Member Posts: 24 |
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
Post
#16
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
Calfaile,
Created a new subform for selecting Backbone & Backbone Resistance Give it a try and see if this works for you.
Attached File(s)
|
|
|
|
Oct 21 2011, 05:00 AM
Post
#17
|
|
|
UtterAccess Member Posts: 24 |
cpetermann,
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, Calfaile |
|
|
|
Oct 21 2011, 05:02 AM
Post
#18
|
|
|
UtterAccess Editor Posts: 4,786 From: Omaha, NE USA |
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 23rd May 2013 - 05:37 PM |