Results 1 to 6 of 6

Thread: (Resolved)Form as progress bar.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2003
    Posts
    253

    (Resolved)Form as progress bar.

    VB Code:
    1. On Error GoTo SQLErr
    2.  
    3.  
    4. If dbCon.State = adStateOpen Then dbCon.Close
    5.  Screen.MousePointer = 11
    6.  Load frmMsgBox
    7.  frmMsgBox.Show 1
    8.  
    9.  
    10. Set dbCon = New Connection
    11. dbCon.CursorLocation = adUseClient
    12. dbCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=XXX;Data Source=XXXX"
    13.  
    14. If dbCon.State = adStateOpen Then
    15.     Screen.MousePointer = 0
    16.     Unload frmMsgBox
    17. End If
    18.  
    19.  
    20. SQLErr:
    21. If Err.Number = -2147467259 Then
    22. unload frmMsgBox
    23. Screen.MousePointer = 0
    24. MsgBox "3 Either SQL or the Server machine is not running." & vbNewLine & "Try again.", vbCritical
    25. ElseIf Err.Number = 0 Then
    26. Exit Sub
    27. Else
    28. MsgBox Err.Number & " " & Err.Description
    29. End If

    I have this code in a module. I am using a Form (frmMsgBox) as to display 'Connecting...'. The problem I am facing is that the form displays but the code after frmMsgBox display does not execute untill I close the form. How can I display the FORM and unload it, if the connection is established.

    Any help?

    Thanks
    Last edited by sillylady; Apr 16th, 2006 at 06:04 AM.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Form as progress bar.

    actually this process will not take long time to display the message 'Connecting...

    when you display a form.show 1 then all the other process proceeding this will not be executed until this form is closed...

    you can display this in a label or status bar...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2003
    Posts
    253

    Re: Form as progress bar.

    Quote Originally Posted by ganeshmoorthy
    actually this process will not take long time to display the message 'Connecting...

    when you display a form.show 1 then all the other process proceeding this will not be executed until this form is closed...

    you can display this in a label or status bar...

    I have seen in many program where such dialog box appears. For example.....if disbale and enable LAN, such form will appear and once LAN is enabled it will disappear.

  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Form as progress bar.

    then try this code

    VB Code:
    1. Load frmMsgBox
    2. frmMsgBox.Show
    3.  
    4. Set dbCon = New Connection
    5. dbCon.CursorLocation = adUseClient
    6. dbCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=XXX;Data Source=XXXX"
    7.  
    8. Screen.MousePointer = 0
    9. Unload frmMsgBox
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2003
    Posts
    253

    Re: Form as progress bar.

    Thank you it is working.

    Quote Originally Posted by ganeshmoorthy
    then try this code

    VB Code:
    1. Load frmMsgBox
    2. frmMsgBox.Show
    3.  
    4. Set dbCon = New Connection
    5. dbCon.CursorLocation = adUseClient
    6. dbCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=XXX;Data Source=XXXX"
    7.  
    8. Screen.MousePointer = 0
    9. Unload frmMsgBox

  6. #6
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Form as progress bar.

    you are most welcome, could you mark this thread as resolved, then...and rate it if you feel to
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width