Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When is True NOT True??? 1

Status
Not open for further replies.

Soundsmith

Programmer
Feb 21, 2001
84
0
0
US
I have a routine in Access 2000 that has worked fine for months, like the following:
Code:
    Select Case theForm
    Case theForm = "FrmAddTrans"
        Set rst = Form_frmAddTrans.RecordsetClone
        obal = rst("orig_bal")
    Case theForm = "FrmRecalcAll"
        Set rst = Form_frmRecalcAll.RecordsetClone
        obal = rst("orig_bal")
    Case Else
        Set rst = Form_frmClaims.subPay.Form.RecordsetClone
        obal = Form_frmClaims.orig_Bal
    End Select
[\code]

It has suddenly stopped functioning - I pass it the form name, "frmAddTrans" and it steps past the case selection to the next case.
I have verified the name, and even checked in Immediate:

? theform="FrmAddTrans"
True

yet it continues to skip past the case.

Any ideas? I've tried rebooting to no avail.

Help, please!
 David 'Dasher' Kempton
The Soundsmith
[URL unfurl="true"]http://www.thesoundsmith.com[/URL]
 
This is very wierd but it works:


Select Case theform
Case Is = "frmAddTrans"
Debug.Print theform
Case Is = "FrmRecalcAll"
Debug.Print theform
Case Else
Debug.Print " no form "
End Select


Your posted code looked fine to me. That's whats odd... Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at
 
Just noticed it also worked like this, with no EQUAL SIGN or IS :

Select Case theform
Case "frmAddTrans"
Debug.Print theform
Case "FrmRecalcAll"
Debug.Print theform
Case Else
Debug.Print " no form " Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at
 
Thanks, WildHare. I didn't try tie IS function, but Case "frmAddTrans" worked just fine.

(Of course, CASE theform="frmAddTrans" worked perfectly for six months! Go figgur [ponder] )
David 'Dasher' Kempton
The Soundsmith
 
Bit decay. Common problem in code that hasn't been varnished with new and improved [red]"ShooBug"[/red].

After a while, acid rain eats away the protective covering of crud and exposes your working code to electron-lossage.

Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
More Neat Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top