Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 2025 
 
slxdeveloper.com Community Forums  
   
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Exit Sub not working
SLX_Novice
Posts: 246
 
Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jun 11 4:14 PM
fiogf49gjkf0d

Hi all.


I have a form in SLX LAN v7.2.1. that has the script below in the ButtonClick event. The problem is that the EXIT SUB line is not working, it keeps the form open. I've used this in other forms and it closes the form once it hits that line. What am I doing wrong? Thank you in advance!


 


Dim objSLXDB4
Dim objRS4
Dim sql_DeliveryStatus

Set objSLXDB4 = New SLX_DB
Set objRS4 = objSLXDB4.GetNewRecordSet

If CheckboxFax.Text = "T" Then

sql_DeliveryStatus = "SELECT    t2.ACCOUNTID, t2.Delivery_Status FROM  Table1  t1 INNER JOIN Table2 t2 ON t1.ACCOUNTID = t2.ACCOUNTID WHERE  t2.Carrier = '" & cmbCarrier.Text & "' AND (t2.C_Carrier_HEADER_ACCOUNTID = '" & txtCarrierHeaderID.Text & "') AND 
(t2.DELIVERY_STATUS = 'Ready') AND (t2.PROMO_FAX = 'T') AND (t1.FAX IS NULL OR t1.FAX = ''OR t1.FAX = ' ')"

objRS4.Open sql_DeliveryStatus,objSLXDB4.Connection

    If objRS4.EOF  Then

      Exit Sub

    End If

objRS4.MoveFirst
Do Until objRS4.EOF

With objRS4

objRS4.Fields("Delivery_Status").Value = "Pending"
objRS4.Update

End With

 objRS4.MoveNext

 Loop

objRS4.Close

Set objSLXDB4 = Nothing

 

Else

msgbox("OK")

End If

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jun 11 5:29 PM
fiogf49gjkf0d
Just use objRS4.recordcount <=0 instead.
[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 11 9:12 AM
fiogf49gjkf0d

Thanks Mike. That still doesn't work, it keeps the (Manage Form) open.

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 11 9:15 AM
fiogf49gjkf0d

The Exit Sub has nothing to do with this - it's what happens on your calling form (or in the same code) that should call something else to close the form. Just Exit Sub will do that. Exits, Finishes. Doesn't mean the form will/should close.

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 11 9:15 AM
fiogf49gjkf0d

The Exit Sub has nothing to do with this - it's what happens on your calling form (or in the same code) that should call something else to close the form. Just Exit Sub will do that. Exits, Finishes. Doesn't mean the form will/should close.

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 11 9:19 AM
fiogf49gjkf0d

Got it. So what do I do if I want to close the form if objRS4.recordcount <=0. I tried using: Application.BasicFunctions.CloseCurrentView False


 


but I get an error: Error BOF or EOF is True, or the curent record has been deleted. Requested operation requires a current record. And it points to the following line of code: objRS4.MoveFirst

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Exit Sub not workingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 11 1:39 PM
fiogf49gjkf0d

I got it to work by calling the cancel button: cancelbutton.click.


 


Thanks!

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/5/2025 9:17:27 AM