| | |
Thread Solved |
•
•
Join Date: Mar 2009
Posts: 810
Reputation:
Solved Threads: 147
•
•
•
•
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. .
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Form_Unload(Cancel As Integer) Cancel = True 'set to any none zero number could be cancel=1 MsgBox "Running, cannot close form now!" End Sub
•
•
Join Date: Jul 2008
Posts: 161
Reputation:
Solved Threads: 1
hi thanks for your code but i have a problem
either bof or eof is true? that is the error. .
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Set rs = New ADODB.Recordset rs.Open "Select * from temp", cn, adOpenKeyset, adLockPessimistic If Val(rs!quantity) = Null Then calcel = False Unload Me Else cancel = True MsgBox "You Must Purchase it First, Before Log out", vbInformation lvButtons_H3.SetFocus End If
•
•
Join Date: Mar 2009
Posts: 810
Reputation:
Solved Threads: 147
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.
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to check if form is open
- Next Thread: how to load a data in mshflexgrid using textmatrix?
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






