Thread Solved

Join Date: Jul 2008
Posts: 161
Reputation: ryan311 has a little shameless behaviour in the past 
Solved Threads: 1
ryan311 ryan311 is offline Offline
Junior Poster

help

 
0
  #1
Mar 7th, 2009
it is possible? if the user in the running time, click the close button or the X button that we can see in the top of the form and then if the user click the close or X button message box will appear "you cannot log out"? how can i do this? thanks. .
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,102
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 91
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Re: help

 
0
  #2
Mar 7th, 2009
why not set the "borderstyle" properties of the form to "0-None" so the form will not display "X" the user will not be able to terminate your program unless user choose to close the program using "task manager"
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 810
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: help

 
0
  #3
Mar 7th, 2009
Originally Posted by ryan311 View Post
it is possible? if the user in the running time, click the close button or the X button that we can see in the top of the form and then if the user click the close or X button message box will appear "you cannot log out"? how can i do this? thanks. .
yes this is possible

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Unload(Cancel As Integer)
  2. Cancel = True 'set to any none zero number could be cancel=1
  3. MsgBox "Running, cannot close form now!"
  4. End Sub
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 161
Reputation: ryan311 has a little shameless behaviour in the past 
Solved Threads: 1
ryan311 ryan311 is offline Offline
Junior Poster

Re: help

 
0
  #4
Mar 7th, 2009
hi thanks for your code but i have a problem

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Set rs = New ADODB.Recordset
  2. rs.Open "Select * from temp", cn, adOpenKeyset, adLockPessimistic
  3. If Val(rs!quantity) = Null Then
  4. calcel = False
  5. Unload Me
  6. Else
  7. cancel = True
  8. MsgBox "You Must Purchase it First, Before Log out", vbInformation
  9. lvButtons_H3.SetFocus
  10. End If
either bof or eof is true? that is the error. .
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 810
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark

Re: help

 
0
  #5
Mar 7th, 2009
Well that is an entirely different animal. Try adding an if statement to check for the existance of a valid recordset...
If rs.BOF = False AND rs.EOF = False AND rs.RowCount <> 0 Then
  'we have a valid recordset with at least one record
End If
Last edited by vb5prgrmr; Mar 7th, 2009 at 12:21 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC