By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 2,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

ListBox Rows Not Displaying Selected State Correctly After Many Requeries

P: 9
this is very weird (and urgent).

when i select rows in a listbox control on a form
, using access vba, some rows behave exactly the opposite of how they're supposed to behave-- they APPEAR unselected when i select them, and selected when i unselect them.

Expand|Select|Wrap|Line Numbers
  1. oListBox.Selected(lngRow) = True 
However, when i check their Selected property with VBA they return the expected value (meaning the row Selected value is TRUE if i set it to TRUE, if tho it LOOKS UNselected).

video:
youtu.be/Ae0adXdmT48

It seems that the more times i requery the listbox, the worse the problem gets.

Expand|Select|Wrap|Line Numbers
  1. oListBox.Requery 
This problem seems unrelated to the number of times i select rows. Only seems related to multiple requeries. At first, it does not happen. Then with repeated requeries, the problem gets progressively worse.

i'm not using the "Form_" syntax anyplace (which can created unintended instances of forms).

also, this listbox query contains a vba function in a module, which in turn calls the code-behind of another form.

help!

note, i may post this question on other MS Access forums, so plz only answer in one place. thx!
Mar 3 '14 #1
Share this Question
Share on Google+
7 Replies


P: 9
Solved.

Problem: when VBA selects all rows in a listbox every time the listbox is requeried, selection behavior gets wonky: some selected rows do not appear selected.

Produces wonky selection behavior:
1. ListBox Where condition changes
2. Requery ListBox
3. Select All ListBox Rows
4. Repeat

Demo of problem:
https://drive.google.com/file/d/0B8F...lh4SDcyUk11bWc

instructions:
https://docs.google.com/document/d/1...avxFRMocvOZ1RY

the fix is to UNselect all rows in the target table before requerying it:

1. ListBox Where condition changes
2. UNselect All ListBox Rows
3. Requery ListBox
4. Select All ListBox Rows
5. Repeat

see debug-fix
https://drive.google.com/file/d/0B8F...3FucTZ0Qm15ekE

i think this might be a Microsoft Access Bug, because the behavior (selected rows appearing unselected) is abnormal.

i'll mark this thread solved, after anybody confirms my fix works.

thx!

(note to moderator: these links are not advertising or spam, they are safe. This thread can be marked solved. -thx)
Apr 21 '14 #2

zmbd
Expert Mod 5K+
P: 5,287
For a listbox control, this is indeed something unusual and most likely has to do with some other underlying formatting/calling script.

video:
youtu.be/Ae0adXdmT48
Please understand, this link is blocked for most if not all of the experts that are helping on Bytes from a secured network, such as myself, neither our IT staff nor our employers can afford to have... well... "those" types of videos available, even as an accident; thus, third party image and video sites are allways blocked.

It seems that the more times i requery the listbox, the worse the problem gets.

Expand|Select|Wrap|Line Numbers
  1. oListBox.Requery 
This problem seems unrelated to the number of times i select rows. Only seems related to multiple requeries. At first, it does not happen. Then with repeated requeries, the problem gets progressively worse.

<<Mod Mix and Mash>>
also, this listbox query contains a vba function in a module, which in turn calls the code-behind of another form.
Hmmm... it sounds as if the control isn't being really cleared as you had intended. I think we'll need to see the code behind the control to figure out the real issue(s)

i'm not using the "Form_" syntax anyplace (which can created unintended instances of forms).
I don't know where you received this information from; however, that is a myth. I've used this syntax for as long as I can remember without there ever being an issue with "unintended instances" of forms being created.


note, i may post this question on other MS Access forums, so plz only answer in one place. thx!
Sorry, that's not a reasonable request.

You post in a forum, that is where your replies to the question is going to be placed. You post in a dozen forums, you can very well expect to have to go to each forum yourself...

Also, cross posting isn't really considered to be proper edicate. Post to a forum, let them answer. If there is no reply or the replies are not helpful then move on.


From your other posts in p2pwox, MSAccess, TechSupport, amongst others:
i think i solved this.

Problem: when VBA selects all rows in a listbox every time the listbox is requeried, selection behavior gets wonky: some selected rows do not appear selected.
This is not true for all listboxes... it appears to be something particular to your project. I have many listboxes where they are often requeried. None of the currently selected/unselected rows are effected. Infact, the new rowsource record is simply appended to the end of the list (which quite often in code I will select, why add it to the list if the user isn't going to select it for later use ?)

i think this might be a Microsoft Access Bug, because the behavior (selected rows appearing unselected) is abnormal.
No, this isn't a general bug in the Access Software. It is something that is occuring in your application.
Apr 21 '14 #3

P: 9
Yes, my mistake, i do mean ListBoxes. Sorry about that. I would have changed the OP title and body, if i could.

I already provided the code samples you requested.

Not sure if we're talking about the same form syntax issue. The form syntax issue i'm referring to is covered here.

You might disagree that this is a Microsoft bug, but the solution i posted does solve the problem, so this thread can be marked solved.
Apr 21 '14 #4

zmbd
Expert Mod 5K+
P: 5,287
Yes, my mistake, i do mean ListBoxes. Sorry about that. I would have changed the OP title and body, if i could.
By the power of the Moderator I wave my fingers.... and presto-chango - no more grids and only a list of things.
(^_^)
(sorry, it's close to lunch and I'm having a most stressful day today; thus, I need a little levity (^_^) )

I already provided the code samples you requested.
I'm sorry, I simply do not see the code that you are referring to, unless you mean those two little orphans in the OP? Or in the links that you have given that I have clearly indicated are not available to many of us that operate from within a secured IT-Environment.

Instead of the third part posts, the code would have to be inserted directly within the thread text.

Not sure if we're talking about the same form syntax issue. The form syntax issue Im referring to is covered here:
Sorry, I had to remove your link as it was broken/malformed. In any case, I'll have to revisit this syntax to see what is happening. So long as one is only using single instances this really shouldn't be an issue; however, that is a topic for another thread.

You might disagree that this is a Microsoft bug,
In this case, it is not that I personally disagree that this is not a bug is by definition: in that only your particular case does this condition seem to be occurring, instead of as a general error, then this is not a bug in the software per-say; however, the root cause cannot be determined by what little information you've provided within the available thread.

but the solution i posted does solve the problem, so this thread can be marked solved
Yes it did solve your issue; however, it does leave the original/root cause undiscovered. (^_^)
Apr 21 '14 #5

P: 9
i updated the link referring to form syntax, see post above.

this is not a bug is by definition: in that only your particular case does this condition seem to be occurring, instead of as a general error.
but you don't know that yet.

apologies, i'd have to do a lot of work to paste in the code, because the sample involves tables, forms with behind code, queries, and a code module. it's not just about the code, it's about the whole application.

sorry, not trying to exclude people behind firewalls, but the solution i found works for me. i'm sorry about people behind firewalls.

this problem is solved for me.

is it your policy that you personally, the mod, confirm that all solutions in this forum are correct solutions, before you allow the OP to mark the thread 'solved'?

if this will help, i exported all db objects as text files (including forms, tables, queries, and modules), according to the instructions here. Instructions are also there for how to import these text files into a db, but i can't guarantee it will work.

Here are the text files for the db that fails:

Form_Units.txt
Expand|Select|Wrap|Line Numbers
  1. Version =20
  2. VersionRequired =20
  3. Checksum =-468999832
  4. Begin Form
  5.     PopUp = NotDefault
  6.     RecordSelectors = NotDefault
  7.     MaxButton = NotDefault
  8.     MinButton = NotDefault
  9.     ControlBox = NotDefault
  10.     AutoCenter = NotDefault
  11.     NavigationButtons = NotDefault
  12.     DividingLines = NotDefault
  13.     AllowDesignChanges = NotDefault
  14.     DefaultView =0
  15.     ScrollBars =0
  16.     TabularCharSet =204
  17.     BorderStyle =3
  18.     PictureAlignment =2
  19.     DatasheetGridlinesBehavior =3
  20.     GridX =24
  21.     GridY =24
  22.     Width =9120
  23.     DatasheetFontHeight =11
  24.     ItemSuffix =53
  25.     Left =9675
  26.     Top =1710
  27.     Right =18795
  28.     Bottom =8835
  29.     DatasheetGridlinesColor =15062992
  30.     Tag ="FilterTable=Units"
  31.     RecSrcDt = Begin
  32.         0xc19249016dd0e340
  33.     End
  34.     GUID = Begin
  35.         0x6c90a421f33ce645b31ba707404de7d0
  36.     End
  37.     NameMap = Begin
  38.         0x0acc0e550000000042a64ffe62be314bb40a24e56b50b25a00000000546e537a ,
  39.         0xb55ce440000000000000000055006e00690074007300000000000000f7d532fe ,
  40.         0x5b608941bf5165311c3d5ef500000000594fe84fba5ce4400000000000000000 ,
  41.         0x570061007200650068006f007500730065007300000000000000cc7564c10f9c ,
  42.         0xfc4ca1cb742a4e87fe370700000042a64ffe62be314bb40a24e56b50b25a5500 ,
  43.         0x6e006900740049004400000000000000407d525408941546ba2febbadb91c3f0 ,
  44.         0x07000000f7d532fe5b608941bf5165311c3d5ef554004a004300000000000000 ,
  45.         0x673a46815e60574bac1cdcfb7133b09a0700000042a64ffe62be314bb40a24e5 ,
  46.         0x6b50b25a54004a00430000000000000000000000000000000000000000000000 ,
  47.         0x0c000000050000000000000000000000000000000000
  48.     End
  49.     Caption ="AHRI Compliance System"
  50.     DatasheetFontName ="Calibri"
  51.     PrtMip = Begin
  52.         0x6801000068010000680100006801000000000000201c0000e010000001000000 ,
  53.         0x010000006801000000000000a10700000100000001000000
  54.     End
  55.     PrtDevMode = Begin
  56.         0x005398afe33e0000bff99088000000004836410000000000a4e1417afc070000 ,
  57.         0x010400069c007803032f010001000100ea0a6f086400010001002c0102000100 ,
  58.         0x2c01030000004c65747465720007000000036a00000000000000000000000000 ,
  59.         0x2005931900000000000000000000000000000000010000000000000001000000 ,
  60.         0x0200000001000000ffffffff4749533400000000000000000000000044494e55 ,
  61.         0x220020015c031c00cad2f6720000000000000000000000000000000000000000 ,
  62.         0x0000000000000000090000000000000000000100000000000000000000000000 ,
  63.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  64.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  65.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  66.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  67.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  68.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  69.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  70.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  71.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  72.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  73.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  74.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  75.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  76.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  77.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  78.         0x00000000000000000000000001000000000000000000000020010000534d544a ,
  79.         0x00000000100010017b00300046003400310033003000440044002d0031003900 ,
  80.         0x430037002d0037006100620036002d0039003900410031002d00390038003000 ,
  81.         0x4600300033004200320045004500340045007d000000496e70757442696e0046 ,
  82.         0x4f524d534f5552434500524553444c4c00556e69726573444c4c00496e746572 ,
  83.         0x6c656176696e67004f464600496d61676554797065004a5045474d6564004f72 ,
  84.         0x69656e746174696f6e00504f52545241495400436f6c6c617465004f46460052 ,
  85.         0x65736f6c7574696f6e004f7074696f6e3100506170657253697a65004c455454 ,
  86.         0x455200436f6c6f724d6f64650032346270700000000000000000000000000000 ,
  87.         0x0000000000000000000000000000000000000000000000001c0000005634444d ,
  88.         0x0100000000000000000000000000000000000000
  89.     End
  90.     PrtDevNames = Begin
  91.         0x0800290047000100000000000000000000000000000000000000000000000000 ,
  92.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  93.         0x00000000000000504f525450524f4d50543a0000000000000000000000000000 ,
  94.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  95.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  96.         0x00000000000000000000000000000000000000000000000000000000000000
  97.     End
  98.     AllowDatasheetView =0
  99.     FilterOnLoad =0
  100.     ShowPageMargins =0
  101.     DatasheetAlternateBackColor =16053492
  102.     DatasheetGridlinesColor12 =15062992
  103.     PrtDevModeW = Begin
  104.         0x00004b000000000000506103000000008000000000000000f08a420000000000 ,
  105.         0xd00000d000000000e0584a0000000000feffffffffffffff403a01b1f7070000 ,
  106.         0x01040006dc007803032f010001000100ea0a6f086400010001002c0102000100 ,
  107.         0x2c01030000004c006500740074006500720000000000000077ad80b0f7070000 ,
  108.         0x7098f701000000005001ce0c000000005001ce0c0000000000004f0800000000 ,
  109.         0x5f00000000000000000000000000000000000000010000000000000001000000 ,
  110.         0x0200000001000000ffffffff4749533400000000000000000000000044494e55 ,
  111.         0x220020015c031c00cad2f6720000000000000000000000000000000000000000 ,
  112.         0x0000000000000000090000000000000000000100000000000000000000000000 ,
  113.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  114.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  115.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  116.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  117.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  118.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  119.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  120.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  121.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  122.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  123.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  124.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  125.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  126.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  127.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  128.         0x00000000000000000000000001000000000000000000000020010000534d544a ,
  129.         0x00000000100010017b00300046003400310033003000440044002d0031003900 ,
  130.         0x430037002d0037006100620036002d0039003900410031002d00390038003000 ,
  131.         0x4600300033004200320045004500340045007d000000496e70757442696e0046 ,
  132.         0x4f524d534f5552434500524553444c4c00556e69726573444c4c00496e746572 ,
  133.         0x6c656176696e67004f464600496d61676554797065004a5045474d6564004f72 ,
  134.         0x69656e746174696f6e00504f52545241495400436f6c6c617465004f46460052 ,
  135.         0x65736f6c7574696f6e004f7074696f6e3100506170657253697a65004c455454 ,
  136.         0x455200436f6c6f724d6f64650032346270700000000000000000000000000000 ,
  137.         0x0000000000000000000000000000000000000000000000001c0000005634444d ,
  138.         0x0100000000000000000000000000000000000000
  139.     End
  140.     PrtDevNamesW = Begin
  141.         0x0400250043000100000000000000000000000000000000000000000000000000 ,
  142.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  143.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  144.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  145.         0x00000000000050004f0052005400500052004f004d00500054003a0000000000 ,
  146.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  147.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  148.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  149.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  150.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  151.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  152.         0x00000000000000000000000000000000000000000000
  153.     End
  154.     NoSaveCTIWhenDisabled =1
  155.     Begin
  156.         Begin Label
  157.             BackStyle =0
  158.             TextAlign =1
  159.             FontSize =18
  160.             ForeColor =-2147483617
  161.             FontName ="Segoe UI"
  162.         End
  163.         Begin CommandButton
  164.             FontSize =11
  165.             FontWeight =400
  166.             ForeColor =-2147483630
  167.             FontName ="Calibri"
  168.             BorderLineStyle =0
  169.         End
  170.         Begin OptionButton
  171.             SpecialEffect =2
  172.             BorderLineStyle =0
  173.             LabelX =230
  174.             LabelY =-30
  175.         End
  176.         Begin CheckBox
  177.             SpecialEffect =2
  178.             BorderLineStyle =0
  179.             LabelX =230
  180.             LabelY =-30
  181.         End
  182.         Begin OptionGroup
  183.             SpecialEffect =3
  184.             BorderLineStyle =0
  185.         End
  186.         Begin TextBox
  187.             FELineBreak = NotDefault
  188.             BorderLineStyle =0
  189.             LabelX =-1800
  190.             FontSize =11
  191.             BorderColor =12632256
  192.             FontName ="Calibri"
  193.             AsianLineBreak =1
  194.         End
  195.         Begin ListBox
  196.             BorderLineStyle =0
  197.             LabelX =-1800
  198.             FontSize =11
  199.             BorderColor =12632256
  200.             FontName ="Calibri"
  201.             AllowValueListEdits =1
  202.             InheritValueList =1
  203.         End
  204.         Begin ComboBox
  205.             BorderLineStyle =0
  206.             LabelX =-1800
  207.             FontSize =11
  208.             BorderColor =12632256
  209.             FontName ="Calibri"
  210.             AllowValueListEdits =1
  211.             InheritValueList =1
  212.         End
  213.         Begin UnboundObjectFrame
  214.             SpecialEffect =2
  215.             OldBorderStyle =1
  216.             ThemeFontIndex =1
  217.             BackThemeColorIndex =1
  218.             BorderThemeColorIndex =1
  219.             BorderShade =65.0
  220.             ForeThemeColorIndex =2
  221.             ForeShade =50.0
  222.             GridlineThemeColorIndex =1
  223.             GridlineShade =65.0
  224.         End
  225.         Begin CustomControl
  226.             OldBorderStyle =1
  227.             BackThemeColorIndex =1
  228.             BorderThemeColorIndex =1
  229.             BorderShade =65.0
  230.             GridlineThemeColorIndex =1
  231.             GridlineShade =65.0
  232.         End
  233.         Begin ToggleButton
  234.             FontSize =11
  235.             FontWeight =400
  236.             ForeColor =-2147483630
  237.             FontName ="Calibri"
  238.             BorderLineStyle =0
  239.         End
  240.         Begin FormHeader
  241.             CanGrow = NotDefault
  242.             Height =660
  243.             BackColor =4874710
  244.             Name ="FormHeader"
  245.             GUID = Begin
  246.                 0xeee4270f3e774040b1c6d74015841a7c
  247.             End
  248.             Begin
  249.                 Begin Label
  250.                     OverlapFlags =85
  251.                     Left =60
  252.                     Top =60
  253.                     Width =2025
  254.                     Height =525
  255.                     ForeColor =-2147483610
  256.                     Name ="Auto_Title0"
  257.                     Caption ="Run Reports"
  258.                     GUID = Begin
  259.                         0x233be54eece5ff4a8eb561de13838aa9
  260.                     End
  261.                     LayoutCachedLeft =60
  262.                     LayoutCachedTop =60
  263.                     LayoutCachedWidth =2085
  264.                     LayoutCachedHeight =585
  265.                 End
  266.             End
  267.         End
  268.         Begin Section
  269.             CanGrow = NotDefault
  270.             Height =6480
  271.             BackColor =11525325
  272.             Name ="Detail"
  273.             GUID = Begin
  274.                 0x9cebdf4edf9c8143a0fdab3dc6a13230
  275.             End
  276.             Begin
  277.                 Begin ListBox
  278.                     ColumnHeads = NotDefault
  279.                     OverlapFlags =85
  280.                     TextFontCharSet =204
  281.                     MultiSelect =1
  282.                     IMESentenceMode =3
  283.                     ColumnCount =4
  284.                     Left =480
  285.                     Top =1440
  286.                     Width =8088
  287.                     Height =4740
  288.                     BorderColor =13936755
  289.                     Name ="lstUnits"
  290.                     RowSourceType ="Table/Query"
  291.                     RowSource ="SELECT Units.UnitID, [Warehouses].TJC FROM Units INNER JOIN Warehouses ON Units."
  292.                         "TJC=[Warehouses].TJC WHERE (((TJCs()) Like \"*,\" & [Warehouses].TJC & \",*\"));"
  293.                         " "
  294.                     ColumnWidths ="3600;2160;1440;1440"
  295.                     Tag ="Fx=Filtered; UnfilteredAll=True"
  296.                     GUID = Begin
  297.                         0xc2e3428740ab9244b1cadeb2493d5e34
  298.                     End
  299.                     GridlineWidthLeft =0
  300.                     GridlineWidthTop =0
  301.                     GridlineWidthRight =0
  302.                     GridlineWidthBottom =0
  303.                     AllowValueListEdits =0
  304.  
  305.                     LayoutCachedLeft =480
  306.                     LayoutCachedTop =1440
  307.                     LayoutCachedWidth =8568
  308.                     LayoutCachedHeight =6180
  309.                 End
  310.                 Begin Label
  311.                     OverlapFlags =85
  312.                     TextAlign =0
  313.                     Left =480
  314.                     Top =900
  315.                     Width =1920
  316.                     Height =532
  317.                     FontWeight =500
  318.                     Name ="Label47"
  319.                     Caption ="Units"
  320.                     GUID = Begin
  321.                         0x757df33acf4c4f4394939959f2875902
  322.                     End
  323.                     GridlineWidthLeft =0
  324.                     GridlineWidthTop =0
  325.                     GridlineWidthRight =0
  326.                     GridlineWidthBottom =0
  327.                     LayoutCachedLeft =480
  328.                     LayoutCachedTop =900
  329.                     LayoutCachedWidth =2400
  330.                     LayoutCachedHeight =1432
  331.                 End
  332.                 Begin CommandButton
  333.                     OverlapFlags =85
  334.                     Left =4560
  335.                     Top =780
  336.                     TabIndex =1
  337.                     Name ="btnAll"
  338.                     Caption ="All"
  339.                     OnClick ="[Event Procedure]"
  340.                     GUID = Begin
  341.                         0x79ddebaf0cabe742b6677669902e96b8
  342.                     End
  343.  
  344.                     LayoutCachedLeft =4560
  345.                     LayoutCachedTop =780
  346.                     LayoutCachedWidth =6000
  347.                     LayoutCachedHeight =1140
  348.                     WebImagePaddingLeft =2
  349.                     WebImagePaddingTop =2
  350.                     WebImagePaddingRight =1
  351.                     WebImagePaddingBottom =1
  352.                 End
  353.                 Begin CommandButton
  354.                     OverlapFlags =85
  355.                     Left =6480
  356.                     Top =780
  357.                     TabIndex =2
  358.                     Name ="btnNone"
  359.                     Caption ="None"
  360.                     OnClick ="[Event Procedure]"
  361.                     GUID = Begin
  362.                         0x9396c2d828e64946a9688ce7cdc6444a
  363.                     End
  364.  
  365.                     LayoutCachedLeft =6480
  366.                     LayoutCachedTop =780
  367.                     LayoutCachedWidth =7920
  368.                     LayoutCachedHeight =1140
  369.                     WebImagePaddingLeft =2
  370.                     WebImagePaddingTop =2
  371.                     WebImagePaddingRight =1
  372.                     WebImagePaddingBottom =1
  373.                 End
  374.             End
  375.         End
  376.         Begin FormFooter
  377.             Visible = NotDefault
  378.             Height =240
  379.             BackColor =15986404
  380.             Name ="FormFooter"
  381.             GUID = Begin
  382.                 0xb91452f47d2ce74aa9089cbde328fff1
  383.             End
  384.         End
  385.     End
  386. End
  387. CodeBehindForm
  388. Attribute VB_GlobalNameSpace = False
  389. Attribute VB_Creatable = True
  390. Attribute VB_PredeclaredId = True
  391. Attribute VB_Exposed = False
  392. Option Compare Database
  393. Option Explicit
  394.  
  395.  
  396. Private Sub btnAll_Click()
  397.     Select_AllListItems lstUnits
  398. End Sub
  399.  
  400.  
  401. Private Sub btnNone_Click()
  402.     Clear_ListSelection lstUnits
  403. End Sub
form_warehouses.txt
Expand|Select|Wrap|Line Numbers
  1. Version =20
  2. VersionRequired =20
  3. Checksum =-805133871
  4. Begin Form
  5.     PopUp = NotDefault
  6.     RecordSelectors = NotDefault
  7.     MaxButton = NotDefault
  8.     MinButton = NotDefault
  9.     ControlBox = NotDefault
  10.     AutoCenter = NotDefault
  11.     NavigationButtons = NotDefault
  12.     DividingLines = NotDefault
  13.     AllowDesignChanges = NotDefault
  14.     DefaultView =0
  15.     ScrollBars =0
  16.     TabularCharSet =204
  17.     BorderStyle =3
  18.     PictureAlignment =2
  19.     DatasheetGridlinesBehavior =3
  20.     GridX =24
  21.     GridY =24
  22.     Width =5820
  23.     DatasheetFontHeight =11
  24.     ItemSuffix =53
  25.     Left =3210
  26.     Top =1740
  27.     Right =9030
  28.     Bottom =8385
  29.     DatasheetGridlinesColor =15062992
  30.     Tag ="FilterTable=Hospitals"
  31.     RecSrcDt = Begin
  32.         0xc19249016dd0e340
  33.     End
  34.     GUID = Begin
  35.         0xd83a58df8f612f479175164bc81ab95e
  36.     End
  37.     NameMap = Begin
  38.         0x0acc0e5500000000f7d532fe5b608941bf5165311c3d5ef500000000594fe84f ,
  39.         0xba5ce4400000000000000000570061007200650068006f007500730065007300 ,
  40.         0x000000000000407d525408941546ba2febbadb91c3f007000000f7d532fe5b60 ,
  41.         0x8941bf5165311c3d5ef554004a00430000000000000000000000000000000000 ,
  42.         0x0000000000000c000000050000000000000000000000000000000000
  43.     End
  44.     Caption ="AHRI Compliance System"
  45.     DatasheetFontName ="Calibri"
  46.     PrtMip = Begin
  47.         0x6801000068010000680100006801000000000000201c0000e010000001000000 ,
  48.         0x010000006801000000000000a10700000100000001000000
  49.     End
  50.     PrtDevMode = Begin
  51.         0x005398afe33e0000bff99088000000004836410000000000a4e1417afc070000 ,
  52.         0x010400069c007803032f000001000100ea0a6f086400010001002c0102000100 ,
  53.         0x2c01030000004c65747465720007000000036a00000000000000000000000000 ,
  54.         0x2005931900000000000000000000000000000000010000000000000001000000 ,
  55.         0x0200000001000000ffffffff4749533400000000000000000000000044494e55 ,
  56.         0x220020015c031c00cad2f6720000000000000000000000000000000000000000 ,
  57.         0x0000000000000000090000000000000000000100000000000000000000000000 ,
  58.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  59.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  60.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  61.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  62.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  63.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  64.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  65.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  66.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  67.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  68.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  69.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  70.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  71.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  72.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  73.         0x00000000000000000000000001000000000000000000000020010000534d544a ,
  74.         0x00000000100010017b00300046003400310033003000440044002d0031003900 ,
  75.         0x430037002d0037006100620036002d0039003900410031002d00390038003000 ,
  76.         0x4600300033004200320045004500340045007d000000496e70757442696e0046 ,
  77.         0x4f524d534f5552434500524553444c4c00556e69726573444c4c00496e746572 ,
  78.         0x6c656176696e67004f464600496d61676554797065004a5045474d6564004f72 ,
  79.         0x69656e746174696f6e00504f52545241495400436f6c6c617465004f46460052 ,
  80.         0x65736f6c7574696f6e004f7074696f6e3100506170657253697a65004c455454 ,
  81.         0x455200436f6c6f724d6f64650032346270700000000000000000000000000000 ,
  82.         0x0000000000000000000000000000000000000000000000001c0000005634444d ,
  83.         0x0100000000000000000000000000000000000000
  84.     End
  85.     PrtDevNames = Begin
  86.         0x0800290047000100000000000000000000000000000000000000000000000000 ,
  87.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  88.         0x00000000000000504f525450524f4d50543a0000000000000000000000000000 ,
  89.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  90.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  91.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  92.         0x000000000000000000000000000000
  93.     End
  94.     AllowDatasheetView =0
  95.     FilterOnLoad =0
  96.     ShowPageMargins =0
  97.     DatasheetAlternateBackColor =16053492
  98.     DatasheetGridlinesColor12 =15062992
  99.     PrtDevModeW = Begin
  100.         0x00004b000000000000506103000000002900000000000000f08a420000000000 ,
  101.         0x9c00009c00000000c0024a0000000000feffffffffffffff403a01b1f7070000 ,
  102.         0x01040006dc007803032f000001000100ea0a6f086400010001002c0102000100 ,
  103.         0x2c01030000004c006500740074006500720000000000000077ad80b0f7070000 ,
  104.         0x7098f701000000005001d90b000000005001d90b000000000000a20900000000 ,
  105.         0x6800000000000000000000000000000000000000010000000000000001000000 ,
  106.         0x0200000001000000ffffffff4749533400000000000000000000000044494e55 ,
  107.         0x220020015c031c00cad2f6720000000000000000000000000000000000000000 ,
  108.         0x0000000000000000090000000000000000000100000000000000000000000000 ,
  109.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  110.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  111.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  112.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  113.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  114.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  115.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  116.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  117.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  118.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  119.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  120.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  121.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  122.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  123.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  124.         0x00000000000000000000000001000000000000000000000020010000534d544a ,
  125.         0x00000000100010017b00300046003400310033003000440044002d0031003900 ,
  126.         0x430037002d0037006100620036002d0039003900410031002d00390038003000 ,
  127.         0x4600300033004200320045004500340045007d000000496e70757442696e0046 ,
  128.         0x4f524d534f5552434500524553444c4c00556e69726573444c4c00496e746572 ,
  129.         0x6c656176696e67004f464600496d61676554797065004a5045474d6564004f72 ,
  130.         0x69656e746174696f6e00504f52545241495400436f6c6c617465004f46460052 ,
  131.         0x65736f6c7574696f6e004f7074696f6e3100506170657253697a65004c455454 ,
  132.         0x455200436f6c6f724d6f64650032346270700000000000000000000000000000 ,
  133.         0x0000000000000000000000000000000000000000000000001c0000005634444d ,
  134.         0x0100000000000000000000000000000000000000
  135.     End
  136.     PrtDevNamesW = Begin
  137.         0x0400250043000100000000000000000000000000000000000000000000000000 ,
  138.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  139.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  140.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  141.         0x00000000000050004f0052005400500052004f004d00500054003a0000000000 ,
  142.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  143.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  144.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  145.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  146.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  147.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  148.         0x0000000000000000000000000000000000000000000000000000000000000000 ,
  149.         0x00000000000000000000000000000000000000000000
  150.     End
  151.     NoSaveCTIWhenDisabled =1
  152.     Begin
  153.         Begin Label
  154.             BackStyle =0
  155.             TextAlign =1
  156.             FontSize =18
  157.             ForeColor =-2147483617
  158.             FontName ="Segoe UI"
  159.         End
  160.         Begin CommandButton
  161.             FontSize =11
  162.             FontWeight =400
  163.             ForeColor =-2147483630
  164.             FontName ="Calibri"
  165.             BorderLineStyle =0
  166.         End
  167.         Begin OptionButton
  168.             SpecialEffect =2
  169.             BorderLineStyle =0
  170.             LabelX =230
  171.             LabelY =-30
  172.         End
  173.         Begin CheckBox
  174.             SpecialEffect =2
  175.             BorderLineStyle =0
  176.             LabelX =230
  177.             LabelY =-30
  178.         End
  179.         Begin OptionGroup
  180.             SpecialEffect =3
  181.             BorderLineStyle =0
  182.         End
  183.         Begin TextBox
  184.             FELineBreak = NotDefault
  185.             BorderLineStyle =0
  186.             LabelX =-1800
  187.             FontSize =11
  188.             BorderColor =12632256
  189.             FontName ="Calibri"
  190.             AsianLineBreak =1
  191.         End
  192.         Begin ListBox
  193.             BorderLineStyle =0
  194.             LabelX =-1800
  195.             FontSize =11
  196.             BorderColor =12632256
  197.             FontName ="Calibri"
  198.             AllowValueListEdits =1
  199.             InheritValueList =1
  200.         End
  201.         Begin ComboBox
  202.             BorderLineStyle =0
  203.             LabelX =-1800
  204.             FontSize =11
  205.             BorderColor =12632256
  206.             FontName ="Calibri"
  207.             AllowValueListEdits =1
  208.             InheritValueList =1
  209.         End
  210.         Begin Subform
  211.             BorderLineStyle =0
  212.             BorderThemeColorIndex =1
  213.             GridlineThemeColorIndex =1
  214.             GridlineShade =65.0
  215.             BorderShade =65.0
  216.             ShowPageHeaderAndPageFooter =1
  217.         End
  218.         Begin ToggleButton
  219.             FontSize =11
  220.             FontWeight =400
  221.             ForeColor =-2147483630
  222.             FontName ="Calibri"
  223.             BorderLineStyle =0
  224.         End
  225.         Begin FormHeader
  226.             CanGrow = NotDefault
  227.             Height =720
  228.             BackColor =4874710
  229.             Name ="FormHeader"
  230.             GUID = Begin
  231.                 0x686d26c44c0fe14fa6e8ba44e89a22de
  232.             End
  233.             Begin
  234.                 Begin Label
  235.                     OverlapFlags =85
  236.                     Left =60
  237.                     Top =60
  238.                     Width =2025
  239.                     Height =525
  240.                     ForeColor =-2147483610
  241.                     Name ="Auto_Title0"
  242.                     Caption ="Run Reports"
  243.                     GUID = Begin
  244.                         0xaa3f2542fa202d47a6c7929658ce51f7
  245.                     End
  246.                     LayoutCachedLeft =60
  247.                     LayoutCachedTop =60
  248.                     LayoutCachedWidth =2085
  249.                     LayoutCachedHeight =585
  250.                 End
  251.             End
  252.         End
  253.         Begin Section
  254.             CanGrow = NotDefault
  255.             Height =5940
  256.             BackColor =11525325
  257.             Name ="Detail"
  258.             GUID = Begin
  259.                 0x271ae52f606d6344bca0886e397f0117
  260.             End
  261.             Begin
  262.                 Begin ListBox
  263.                     ColumnHeads = NotDefault
  264.                     OverlapFlags =85
  265.                     TextFontCharSet =204
  266.                     MultiSelect =1
  267.                     IMESentenceMode =3
  268.                     ColumnCount =3
  269.                     Left =483
  270.                     Top =716
  271.                     Width =4807
  272.                     Height =4623
  273.                     BorderColor =13936755
  274.                     Name ="lstWarehouses"
  275.                     RowSourceType ="Table/Query"
  276.                     RowSource ="SELECT [Warehouses].TJC FROM Warehouses; "
  277.                     ColumnWidths ="3600;720;720;720;0"
  278.                     OnClick ="[Event Procedure]"
  279.                     Tag ="Fx=Filtered; UnfilteredAll=False"
  280.                     GUID = Begin
  281.                         0x71fa1286d914c544acc486ec65649d62
  282.                     End
  283.                     GridlineWidthLeft =0
  284.                     GridlineWidthTop =0
  285.                     GridlineWidthRight =0
  286.                     GridlineWidthBottom =0
  287.                     AllowValueListEdits =0
  288.  
  289.                     LayoutCachedLeft =483
  290.                     LayoutCachedTop =716
  291.                     LayoutCachedWidth =5290
  292.                     LayoutCachedHeight =5339
  293.                     Begin
  294.                         Begin Label
  295.                             OverlapFlags =85
  296.                             TextAlign =0
  297.                             Left =480
  298.                             Top =180
  299.                             Width =2025
  300.                             Height =525
  301.                             FontWeight =500
  302.                             Name ="HospitalID_Label"
  303.                             Caption ="Warehouses"
  304.                             GUID = Begin
  305.                                 0xe21e99a7aacabf45abc90c7bf8da591f
  306.                             End
  307.                             GridlineWidthLeft =0
  308.                             GridlineWidthTop =0
  309.                             GridlineWidthRight =0
  310.                             GridlineWidthBottom =0
  311.                             LayoutCachedLeft =480
  312.                             LayoutCachedTop =180
  313.                             LayoutCachedWidth =2505
  314.                             LayoutCachedHeight =705
  315.                         End
  316.                     End
  317.                 End
  318.             End
  319.         End
  320.         Begin FormFooter
  321.             Visible = NotDefault
  322.             Height =240
  323.             BackColor =15986404
  324.             Name ="FormFooter"
  325.             GUID = Begin
  326.                 0xcef0c693f27e8f468cbf4a105bfb8b7f
  327.             End
  328.         End
  329.     End
  330. End
  331. CodeBehindForm
  332. Attribute VB_GlobalNameSpace = False
  333. Attribute VB_Creatable = True
  334. Attribute VB_PredeclaredId = True
  335. Attribute VB_Exposed = False
  336. Option Compare Database
  337. Option Explicit
  338.  
  339. Dim msItemsSelected As String
  340.  
  341.  
  342. Public Function TJCs() As String
  343. ' return string of selected orgs (Warehouses)
  344.     TJCs = Get_CommaString(lstWarehouses)
  345. End Function
  346.  
  347.  
  348. Private Sub lstWarehouses_Click()
  349.     Forms("Units").lstUnits.Requery
  350.     Select_AllListItems Forms("Units").lstUnits, Forms("Units").btnAll
  351. End Sub
Module_Fx.txt
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4.  
  5.  
  6. Sub Clear_ListSelection(oList As ListBox)
  7. ' clear listbox selection
  8.     PaintOff oList
  9.  
  10.     Dim Itm
  11.     For Each Itm In oList.ItemsSelected
  12.         oList.Selected(Itm) = False
  13.     Next Itm
  14.  
  15.     ScrollToTop oList
  16.     PaintOn oList
  17. End Sub
  18.  
  19.  
  20. Sub PaintOff(oList As ListBox)
  21. ' turn off screen updating
  22.     DoCmd.Echo False
  23.     oList.Visible = False
  24. End Sub
  25.  
  26.  
  27. Sub PaintOn(oList As ListBox)
  28. ' turn on screen updating
  29.     oList.Visible = True
  30.     DoCmd.Echo True
  31. End Sub
  32.  
  33.  
  34. Function TJCs()
  35.     TJCs = Forms("Warehouses").TJCs
  36. End Function
  37.  
  38.  
  39. Function Get_CommaString(oList As ListBox) As String
  40. ' return selected items in listbox as comma-delim string
  41.  
  42.     oList.Requery
  43.     If (oList.ItemsSelected.Count = 0) Then Exit Function
  44.  
  45.     ' get col num
  46.     Dim iCol As Integer
  47.     iCol = 0
  48.  
  49.     ' starting delim
  50.     Dim sList As String
  51.     sList = ","
  52.  
  53.     Dim vSelectionNumber As Variant, vListItem As Variant, sSelectedItem As String
  54.     For Each vSelectionNumber In oList.ItemsSelected
  55.         vListItem = oList.Column(iCol, vSelectionNumber)
  56.         sList = sList & vListItem & ","
  57.     Next vSelectionNumber
  58.  
  59.     ' hack leading and trailing comma
  60.     sList = Mid$(sList, 2, Len(sList) - 2)
  61.     Get_CommaString = sList
  62. End Function
  63.  
  64.  
  65. Sub Select_AllListItems(oList As ListBox, Optional btnSafe As CommandButton)
  66. ' select all items in list
  67.     If TypeName(btnSafe) <> "Nothing" Then btnSafe.SetFocus
  68.     PaintOff oList
  69.  
  70.     Dim lngRow As Long
  71.     For lngRow = 0 To oList.ListCount - 1
  72.         oList.Selected(lngRow) = True
  73.     Next
  74.  
  75.     ScrollToTop oList
  76.     PaintOn oList
  77. End Sub
  78.  
  79.  
  80. Sub ScrollToTop(oListBox As ListBox)
  81. ' for multiselect listboxes
  82.     oListBox.Selected(0) = True
  83. End Sub
Query_~sq_cCopy Of Hospitals~sq_clstHospitals.txt
Expand|Select|Wrap|Line Numbers
  1. dbMemo "SQL" ="SELECT Hospitals.TJC\015\012FROM Hospitals;\015\012"
  2. dbMemo "Connect" =""
  3. dbBoolean "ReturnsRecords" ="-1"
  4. dbInteger "ODBCTimeout" ="60"
  5. dbText "KeepLocal" ="T"
  6. Begin
  7. End
  8.  
Query_~sq_cCopy Of Units~sq_clstUnits.txt
Expand|Select|Wrap|Line Numbers
  1. dbMemo "SQL" ="SELECT Units.UnitID, Hospitals.TJC\015\012FROM Units INNER JOIN Hospitals ON Uni"
  2.     "ts.[TJC] = Hospitals.TJC\015\012WHERE (((TJCs()) Like \"*,\" & [Hospitals].[TJC]"
  3.     " & \",*\"));\015\012"
  4. dbMemo "Connect" =""
  5. dbBoolean "ReturnsRecords" ="-1"
  6. dbInteger "ODBCTimeout" ="60"
  7. dbText "KeepLocal" ="T"
  8. Begin
  9. End
  10.  
Query_~sq_cUnits~sq_clstUnits.txt
Expand|Select|Wrap|Line Numbers
  1. dbMemo "SQL" ="SELECT Units.UnitID, [Warehouses].TJC\015\012FROM Units INNER JOIN Warehouses ON"
  2.     " Units.TJC=[Warehouses].TJC\015\012WHERE (((TJCs()) Like \"*,\" & [Warehouses].T"
  3.     "JC & \",*\"));\015\012"
  4. dbMemo "Connect" =""
  5. dbBoolean "ReturnsRecords" ="-1"
  6. dbInteger "ODBCTimeout" ="60"
  7. dbText "KeepLocal" ="T"
  8. Begin
  9. End
  10.  
Table_Units.txt
Expand|Select|Wrap|Line Numbers
  1. "UnitID","TJC","TJCdbl"
  2. "1ne-gil",4546.00,4546.00
  3. "1su",4676.00,4676.00
  4. "2an-ms",10076.00,10076.00
  5. "2bn-onc",10076.00,10076.00
  6. "2cn-med",10076.00,10076.00
  7. "2d",9920.00,9920.00
  8. "2dn-o",10076.00,10076.00
  9. "2e-ms",10076.00,10076.00
  10. "2nd",2868.00,2868.00
  11. "2neb-icus",4546.00,4546.00
  12. "2ne-pacu",4546.00,4546.00
  13. "2ne-surg",4546.00,4546.00
  14. "2n-icum",4546.00,4546.00
  15. "2n-ms",10161.00,10161.00
  16. "2s-ms",10076.00,10076.00
  17. "2sne-ss-if",4546.00,4546.00
  18. "2s-pacu",4546.00,4546.00
  19. "2s-surg",4546.00,4546.00
  20. "2w-ms",2720.00,2720.00
  21. "3an-t",10076.00,10076.00
  22. "3bn-vp",10076.00,10076.00
  23. "3c-ar",2720.00,2720.00
  24. "3cn-n-s",10076.00,10076.00
  25. "3dn-ar",10076.00,10076.00
  26. "3e-sd",10076.00,10076.00
  27. "3ne-ld",4546.00,4546.00
  28. "3ne-nicu",4546.00,4546.00
  29. "3n-t",4546.00,4546.00
  30. "3rd",2868.00,2868.00
  31. "3s-t",10076.00,10076.00
  32. "3w-t",2720.00,2720.00
  33. "4e-brges",2720.00,2720.00
  34. "4e-ms",10076.00,10076.00
  35. "4mc",4676.00,4676.00
  36. "4mso",4676.00,4676.00
  37. "4mst",4676.00,4676.00
  38. "4ne-mb",4546.00,4546.00
  39. "4n-ms",10161.00,10161.00
  40. "4s-ms",4546.00,4546.00
  41. "4s-t",4546.00,4546.00
  42. "4s-t",10076.00,10076.00
  43. "4w-tcu",2720.00,2720.00
  44. "5c-mb",2720.00,2720.00
  45. "5e-ld",2720.00,2720.00
  46. "5n-ar-pt-ot",4546.00,4546.00
  47. "5ne-ms",4546.00,4546.00
  48. "5n-ms",10161.00,10161.00
  49. "5s-ms",4546.00,4546.00
  50. "5t-ms",10161.00,10161.00
  51. "6ne-onc",4546.00,4546.00
  52. "6s-t",4546.00,4546.00
  53. "7ne-ped",4546.00,4546.00
  54. "ais",2868.00,2868.00
  55. "angio",4676.00,4676.00
  56. "aou",4676.00,4676.00
  57. "bb",4676.00,4676.00
  58. "bb-lab",4546.00,4546.00
  59. "bc",4546.00,4546.00
  60. "bdxc",10161.00,10161.00
  61. "bl-dn",4546.00,4546.00
  62. "brges-op",2720.00,2720.00
  63. "card",2720.00,2720.00
  64. "card",10161.00,10161.00
  65. "card",470962.00,470962.00
  66. "card-pulm",2868.00,2868.00
  67. "card-rehab",2868.00,2868.00
  68. "card-stl",4676.00,4676.00
  69. "cardx",4546.00,4546.00
  70. "car-pul",4676.00,4676.00
  71. "cc",4546.00,4546.00
  72. "ccc",2720.00,2720.00
  73. "ccl",4546.00,4546.00
  74. "ccl",4676.00,4676.00
  75. "ccl",10076.00,10076.00
  76. "ccl",10161.00,10161.00
  77. "ccu",2868.00,2868.00
  78. "cdou",4676.00,4676.00
  79. "cdu",2720.00,2720.00
  80. "cdu-op",2720.00,2720.00
  81. "chdp",10161.00,10161.00
  82. "cl",9920.00,9920.00
  83. "cl",470962.00,470962.00
  84. "clin",447939.00,447939.00
  85. "coup",9920.00,9920.00
  86. "cp",2720.00,2720.00
  87. "cp",447939.00,447939.00
  88. "cr",10076.00,10076.00
  89. "c-rehab",10161.00,10161.00
  90. "c-rehab",470962.00,470962.00
  91. "cs",10161.00,10161.00
  92. "cs-mri",4546.00,4546.00
  93. "cto",447939.00,447939.00
  94. "cv",10076.00,10076.00
  95. "cvi",470962.00,470962.00
  96. "cvor",470962.00,470962.00
  97. "cvu",470962.00,470962.00
  98. "dadc",4676.00,4676.00
  99. "dcc",470962.00,470962.00
  100. "dial",10161.00,10161.00
  101. "di-pro",2868.00,2868.00
  102. "dou",470962.00,470962.00
  103. "ds",10161.00,10161.00
  104. "ed",2720.00,2720.00
  105. "ed",2868.00,2868.00
  106. "ed",4546.00,4546.00
  107. "ed",4676.00,4676.00
  108. "ed",9920.00,9920.00
  109. "ed",10076.00,10076.00
  110. "ed",10161.00,10161.00
  111. "ed",470962.00,470962.00
  112. "edo",4676.00,4676.00
  113. "edou",4676.00,4676.00
  114. "edou-cdou",4676.00,4676.00
  115. "edx",10076.00,10076.00
  116. "endo-gil",10161.00,10161.00
  117. "eng",2868.00,2868.00
  118. "gi-bl",2720.00,2720.00
  119. "gil",9920.00,9920.00
  120. "gil",10076.00,10076.00
  121. "gil",470962.00,470962.00
  122. "gilab",4676.00,4676.00
  123. "gyn",10161.00,10161.00
  124. "hair",9920.00,9920.00
  125. "hc",2868.00,2868.00
  126. "hc",4546.00,4546.00
  127. "hc",447939.00,447939.00
  128. "hh",4676.00,4676.00
  129. "hr-ob",470962.00,470962.00
  130. "hskp",2868.00,2868.00
  131. "ic",10076.00,10076.00
  132. "iccu-2",10161.00,10161.00
  133. "iccu-7",10161.00,10161.00
  134. "icu",4676.00,4676.00
  135. "icu",9920.00,9920.00
  136. "icu",470962.00,470962.00
  137. "icu-b",10161.00,10161.00
  138. "img",447939.00,447939.00
  139. "img",470962.00,470962.00
  140. "inf",447939.00,447939.00
  141. "int",447939.00,447939.00
  142. "ir",10076.00,10076.00
  143. "ir",470962.00,470962.00
  144. "ir-spl",2720.00,2720.00
  145. "iru",2720.00,2720.00
  146. "it-4mso",4676.00,4676.00
  147. "it-sds",4676.00,4676.00
  148. "lab",2720.00,2720.00
  149. "lab",2868.00,2868.00
  150. "lab",10076.00,10076.00
  151. "lab",470962.00,470962.00
  152. "lab-bb",10161.00,10161.00
  153. "lab-opd",4676.00,4676.00
  154. "lc",10161.00,10161.00
  155. "ld",2868.00,2868.00
  156. "ld",4676.00,4676.00
  157. "ld",9920.00,9920.00
  158. "ld",10076.00,10076.00
  159. "ld",10161.00,10161.00
  160. "ld",470962.00,470962.00
  161. "mb",10161.00,10161.00
  162. "mi",10076.00,10076.00
  163. "mi-ir",4546.00,4546.00
  164. "m-or",10161.00,10161.00
  165. "mri",2720.00,2720.00
  166. "mri",10076.00,10076.00
  167. "mri",470962.00,470962.00
  168. "mri-rad",10161.00,10161.00
  169. "ms2",470962.00,470962.00
  170. "ms3",470962.00,470962.00
  171. "ms4",470962.00,470962.00
  172. "ms-e",9920.00,9920.00
  173. "ms-w",9920.00,9920.00
  174. "neurodx",2720.00,2720.00
  175. "nicu",4676.00,4676.00
  176. "nicu",9920.00,9920.00
  177. "nicu",10161.00,10161.00
  178. "nicu",470962.00,470962.00
  179. "nicu-nsy",10076.00,10076.00
  180. "ni-us",4546.00,4546.00
  181. "ns1",6499.00,6499.00
  182. "ns2",6499.00,6499.00
  183. "ns3",6499.00,6499.00
  184. "nsy",2868.00,2868.00
  185. "nsy",470962.00,470962.00
  186. "nutr",2868.00,2868.00
  187. "odc",10076.00,10076.00
  188. "onc",470962.00,470962.00
  189. "opdx",4546.00,4546.00
  190. "opr",10076.00,10076.00
  191. "opt",470962.00,470962.00
  192. "or",2720.00,2720.00
  193. "ortho",9920.00,9920.00
  194. "os",4546.00,4546.00
  195. "os",4676.00,4676.00
  196. "os",470962.00,470962.00
  197. "pacu",2720.00,2720.00
  198. "pacu",2868.00,2868.00
  199. "pacu",9920.00,9920.00
  200. "pacu",10076.00,10076.00
  201. "pacu",10161.00,10161.00
  202. "pacu",470962.00,470962.00
  203. "pal",2868.00,2868.00
  204. "pava",10076.00,10076.00
  205. "pavb",10076.00,10076.00
  206. "pavc",10076.00,10076.00
  207. "pcu-6",10161.00,10161.00
  208. "pcu-7",10161.00,10161.00
  209. "ped",4676.00,4676.00
  210. "ped",9920.00,9920.00
  211. "ped",10161.00,10161.00
  212. "ped",470962.00,470962.00
  213. "peds",2868.00,2868.00
  214. "pharm",2868.00,2868.00
  215. "pharm",4546.00,4546.00
  216. "pharm",4676.00,4676.00
  217. "phm",2720.00,2720.00
  218. "phm",10076.00,10076.00
  219. "phm",10161.00,10161.00
  220. "phm",447939.00,447939.00
  221. "phm",470962.00,470962.00
  222. "picu",470962.00,470962.00
  223. "pl",2720.00,2720.00
  224. "pl-abg",10076.00,10076.00
  225. "pol",10161.00,10161.00
  226. "pom",4676.00,4676.00
  227. "pp",10076.00,10076.00
  228. "pp",470962.00,470962.00
  229. "pr",10076.00,10076.00
  230. "ptot-ohc",4546.00,4546.00
  231. "pt-ots",4676.00,4676.00
  232. "pt-ot-sp",2720.00,2720.00
  233. "pt-wd",10161.00,10161.00
  234. "ql",447939.00,447939.00
  235. "rad",470962.00,470962.00
  236. "rad-ct",10161.00,10161.00
  237. "rad-dx",10161.00,10161.00
  238. "rad-mri-us-nm",4676.00,4676.00
  239. "rad-nm",10161.00,10161.00
  240. "rad-onc",10161.00,10161.00
  241. "rad-us",10161.00,10161.00
  242. "rd-oc",447939.00,447939.00
  243. "rehab-e",2868.00,2868.00
  244. "rehb-svc",10161.00,10161.00
  245. "resbro",4676.00,4676.00
  246. "res-pulm",10161.00,10161.00
  247. "rr",4676.00,4676.00
  248. "rs",9920.00,9920.00
  249. "rv-el",2868.00,2868.00
  250. "rv-wp",2868.00,2868.00
  251. "scvi",10076.00,10076.00
  252. "scvr",10076.00,10076.00
  253. "sds",2720.00,2720.00
  254. "sds",4676.00,4676.00
  255. "sds",9920.00,9920.00
  256. "sds",470962.00,470962.00
  257. "s-lab",10161.00,10161.00
  258. "spc",2868.00,2868.00
  259. "spec-rad",10161.00,10161.00
  260. "ss",10076.00,10076.00
  261. "ss",10161.00,10161.00
  262. "surg",2868.00,2868.00
  263. "surg",4676.00,4676.00
  264. "surg",9920.00,9920.00
  265. "surg",10076.00,10076.00
  266. "surg-m",470962.00,470962.00
  267. "tcc",4676.00,4676.00
  268. "tele",9920.00,9920.00
  269. "umc",447939.00,447939.00
  270. "vasdx",4546.00,4546.00
  271. "vroc",4546.00,4546.00
  272. "wc",470962.00,470962.00
  273. "whc",2868.00,2868.00
  274. "whc",9920.00,9920.00
  275. "wh-han",4676.00,4676.00
  276. "wh-her",4676.00,4676.00
  277. "wnd-c",470962.00,470962.00
  278. "ww-bc",4676.00,4676.00
  279.  
Table_Warehouses.txt
Expand|Select|Wrap|Line Numbers
  1. "TJC"
  2. 2720.00
  3. 2868.00
  4. 4546.00
  5. 4676.00
  6. 6499.00
  7. 9920.00
  8. 10076.00
  9. 10161.00
  10. 447939.00
  11. 470962.00
  12.  
After importing:
-Open the Warehouse form first.

-Then open the Units form.

-Arrange the forms side-by-side.

-Then click inside the Warehouses listbox repeatedly, to select and deselect rows randomly. As you click, you’ll see the Units list update, and all rows get selected. That’s the correct behavior.

-After about 20 clicks, you’ll see the Units list begin to display weirdly. Sometimes, it will appear empty. Sometimes, it will update, but nothing will get selected.

-View the VBA modules to understand how it works.

-You can comment out the echo, .visible, and scrollToTop code. On the developer’s computer, this will not prevent the display corruption.

Let me know if you are able to import the files above, and i will send you the text files for the solution.
Apr 21 '14 #6

zmbd
Expert Mod 5K+
P: 5,287
well... that will take a little bit to digest. (^_^)
we really only need the code that directly affects the listbox.

-
is it your policy that you personally, the mod, confirm that all solutions in this forum are correct solutions, before you allow the OP to mark the thread 'solved'?
Moderators can see what has been done and we peer review so never-fear, things are rarely just "done" without someone following-up.

The reasons I reset your post from being best answer:
1) The root cause hasn't been determined. This is the primary reason. Without establishing the root cause, it is difficult to determine if your own solution is actually the best.

2) Reporting an unconfirmed bug in the software as part of your solution. This more of a contributing/supporting factor - unless some other supporting information becomes available to confirm this as a software glitch.
Apr 21 '14 #7

P: 9
i didn't "report" a bug, it just seems to be a bug to me.

unless some other supporting information becomes available to confirm this as a software glitch.
I believe my problem and solution, when compared, support the bug hypothesis, but you can judge for yourself.
Apr 21 '14 #8

Post your reply

Sign in to post your reply or Sign up for a free account.