When I try to run it I get an error message because RotateText.ocx is missing. I can ignore that (I think) but there are also errors involving two missing references, PISDK 1.3 type library and PISDKParse 1.1 type library. If I comment out the global references to them I get to frmMain Form_Load and I run into this.
BTW, it's a very common mistake but in Dim i, j, k As Integer only k is actually defined as an Integer and the other two are left as Variants.
Wasn't aware of that (saw others doing this and thought it was OK). Thanks for the tip.
As for the other problem. Did you rem out the call to PIConnect (uses the PISDKs which are used by dedicated server you don't need). Attached is the RotateText.ocx. Are you saying the program "hangs" when you get to "ListIndex = 0"? Maybe it's related somehow to the error messages you received.
I removed your RotateText.ocx because I assume it's a commercial product. I did rem out the call to PIConnect but that doesn't affect the fact that I don't have those references since there are variables that refer to them. Regarding ListIndex = 0, no it doesn't hang, it's just that that is not valid code and so the program won't run. The ListIndex must be associated with a ListBox or Combobox, eg MyListbox.ListIndex = 0.
As for the PI-SDKs, I just realized it is because the app specifies these under Project>>References. Will have to PM you a revised vbp file. As for the "ListIndex = 0", I rem'd this.
strStep is referenced in RefreshRecipeGrid but it isn't defined within the scope of that sub. It is defined in LoadRecipe. Did you mean it to be global or should I add a Dim for it in RefreshRecipeGrid? BTW, you have strStep defined as a string, but you use it as a counter. It should be a Long or an Integer (and iof course you should then call it lngStep or intStep).
I've just realized that your problem may be because you have code problems even though you were obviously able to compile your program. I compiled it too, once, but when I tried it again starting with a different sub open the compile failed. If you have invalid code in a compiled program I assume you can get weird results.
You will need to move the code to a sub and then call it when you need it. You will need to redo your routine and move it to a module for various forms call these routine and in turn run the code in the cboApprovedDate_Change() routine.
strStep is referenced in RefreshRecipeGrid but it isn't defined within the scope of that sub. It is defined in LoadRecipe. Did you mean it to be global or should I add a Dim for it in RefreshRecipeGrid? BTW, you have strStep defined as a string, but you use it as a counter. It should be a Long or an Integer (and iof course you should then call it lngStep or intStep).
You are correct. It should be an integer. I've not defined Option Explicit so it is not reallyb necessary to define it. But if it were, it should be global (I have a module where I define the Public variables).
I knew that each time the user clicked on the current or next grade buttons that the cboApproved was updated and it's Change event would be triggered, which would initiate the query. An option would be to put the query in a module and call it from the cmdCurrGrade and cmdNextGrade buttons. But what would I do if I want use the cboApproved to select a new date? If I tried calling the module from the cboApproved Change or Click event I run into the same problem as if I put the query within the event. Any thoughts/suggestions?
We seem to have come full circle on this. Above is a quote from an earlier posting. Really appreciate you guys sticking with me for so long on this one. My coding skills are modest and I've picked up a lot of useful info unrelated to my problem in this thread. But the problem remains. How can I address the issue in the above quote? Is there a difference between _Change and _Click where they are invoked under different conditions?
Even if you selected a different date in the cboApprovedDate combo box, the Change event would not fire. So, having the routine in that sub would not amount to much, except trouble.
Here is a program I put together for you to see what I mean. Put a break point on the DoEvents in the Change Event and select an item.
Yes I did try it. I can see the difference between the _Click and _Change events. Will try to see how I can use this to get around my problem. BTW - didn't have time to respond to your emails (if that's what you miffed about). Will do so now.
Well, Did you try the code? You probably have even seen my other post have you?
Ah... I see why you're miffed with me. You probably didn't realize that my Post #55 was in response to your Post #50 (amazing... is this a record for number of postings). Sorry for any confusion. What you pointed out is the crux of my problem I believe.