Re: Problem with executable file
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.
VB Code:
Private Sub Form_Load()
Dim intCol As Integer
Dim intwidthcounter As Integer
Dim colcounter As Integer
Dim rowcounter As Integer
Dim i, j, k As Integer
Dim optButton As Integer
Dim CurrentTab As Integer
frmMain.Caption = "Manual Entry PM10 - Revised July 4, 2005" 'frmMain.Caption & " (Version " & App.Major & "." & _
App.Minor & "." & App.Revision & ")"
[HL="#FF8080"]ListIndex = 0[/HL]
How can that compile?
Re: Problem with executable file
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.
Re: Problem with executable file
Quote:
Originally Posted by MartinLiss
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.
Re: Problem with executable file
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.
Re: Problem with executable file
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.
Re: Problem with executable file
OK, using your new files I can get it to run after doing the following and a few other things.
VB Code:
' Public srvPI As PISDK.server
Public strMessage As String
Public con_lngError As Long
' Public p_ptPoint As PIPoint
' Public alAlias As PIAlias
' Public mod_Level As PISDK.PIModule
Please tell me exactly how to reproduce your problem after I compile.
Re: Problem with executable file
I'm sorry but ListIndex = 0 still isn't valid. What is it that you are trying to do with that statement?
Re: Problem with executable file
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).
Re: Problem with executable file
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.
Re: Problem with executable file
Stan,
Each time you call GetBackUpCurrent() or GetBackUpNext() it will trigger cboAppovedDate() because you change the text of cboApprovedDate.
VB Code:
frmMain.cboApproved.text = frmBackUpCurr10.lblDateApprove.Caption
and
frmMain.cboApproved.text = frmBackUpCurr10.lblDateApprove.Caption
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.
Your problem is procedural.
Re: Problem with executable file
Quote:
Originally Posted by MartinLiss
OK, using your new files I can get it to run after doing the following and a few other things.
VB Code:
' Public srvPI As PISDK.server
Public strMessage As String
Public con_lngError As Long
' Public p_ptPoint As PIPoint
' Public alAlias As PIAlias
' Public mod_Level As PISDK.PIModule
Please tell me
exactly how to reproduce your problem after I compile.
Using the drop downbox, load one of the 2 grades. Then load the 2nd grade. Now toggle back and forth on the Current Grade and Next Grade buttons.
Re: Problem with executable file
Quote:
Originally Posted by MartinLiss
I'm sorry but ListIndex = 0 still isn't valid. What is it that you are trying to do with that statement?
It's not necessary in the code. It should be rem'd out.
Re: Problem with executable file
Quote:
Originally Posted by MartinLiss
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).
Re: Problem with executable file
Stan,
I guess you didn't like my comments ... I feel slighted :wave:
Re: Problem with executable file
Quote:
Originally Posted by Stan
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?
Cheers
1 Attachment(s)
Re: Problem with executable file
Stan,
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.
Re: Problem with executable file
Quote:
Originally Posted by randem
Stan,
I guess you didn't like my comments ... I feel slighted :wave:
Not sure what I did to offend you... but my apologies anyway :thumb:
Re: Problem with executable file
Stan,
Well, Did you try the code? You probably have even seen my other post have you?
Re: Problem with executable file
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. :thumb:
Re: Problem with executable file
Quote:
Originally Posted by randem
Stan,
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.