The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Code worked under 6.2.6 but not 7.2
Posted: 19 May 08 3:15 PM
|
Not sure why this isn't working:
sub FormSecurity dim formNotePad dim formTasks dim strUSER, bolADMIN
strUSER = application.BasicFunctions.CurrentUserID If strUSER = "ADMIN" or strUSER = "U6UJ9A00002H" or strUSER = lveImpRep.LookupID then bolADMIN = TRUE else bolADMIN = FALSE End IF
Set formTasks = Application.Forms.Item("Implementation:Tasks") Set formNotePad = Application.Forms.Item("Implementation:NotePad")
if bolADMIN = FALSE then LockFields pklStatus.ReadOnly = TRUE formTasks.grdImpProcess.ENABLED = FALSE formNotePad.btnAddNote.Enabled = FALSE formNotePad.mmoEnterNotes.ReadOnly = TRUE else UnlockFields pklStatus.ReadOnly = FALSE formTasks.grdImpProcess.ENABLED = TRUE formNotePad.btnAddNote.Enabled = TRUE formNotePad.mmoEnterNotes.ReadOnly = FALSE end if
Set formTasks = Nothing Set formNotePad = Nothing End Sub
================
The form fails at: formNotePad.btnAddNote.Enabled = FALSE/TRUE (fails the same if ADMIN or not) I've confirmed that the button is indeed named this. The error is: "Object required". |
|
|
|
Re: Code worked under 6.2.6 but not 7.2
Posted: 19 May 08 3:34 PM
|
Sounds like it isn't finding the form, so you're ending up with a null reference (which causes the error when you try to use it). Could that be the case, that the form isn't loaded yet? |
|
|
|
Re: Code worked under 6.2.6 but not 7.2
Posted: 19 May 08 3:45 PM
|
The subroutine is called on the detail form OnChange event. I could recreate the code for each tab form but it seems like that would be a bit backwards after being able to do this in 6.2.x
You can see the forms in the tab view, so it's not like they aren't released and I've checked and double checked the form names. |
|
|
| |
| |
|
Re: Code worked under 6.2.6 but not 7.2
Posted: 20 May 08 6:46 PM
|
So not running SQL Server 2005 or Visual Studio? I probably don't need to tell you how much easier your life would become if you could get hold of one of these.
MS Script debugger does not have a watch window as such, but you can still use it to inspect the contents of single-valued variables (I haven't managed to inspect objects with it) using the Command window.
Phil |
|
|
|
Re: Code worked under 6.2.6 but not 7.2
Posted: 21 May 08 7:21 AM
|
Phil,
Nope, no SQL 2005. We are running our database on Oracle. I've requested Visual Studio, but that might take awhile.
What command would you use in the MS Script Debugger? |
|
|
| |
|