By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

how do I "FORMS"

P: n/a
Dib
Hi,

how do I call a form to open from another form.

example

I have a frmLogIn and an frmError

The frmError have a ListBox. If the frmLogin generated an error I want the
error to show in the ListBox on frmError.

Here is the code I have

Private Sub ErrorLog()

Dim errLoop As ADODB.Error

' Change mousepointer to normal.

System.Windows.Forms.Cursor.Current =
System.Windows.Forms.Cursors.WaitCursor

Select Case errcase

Case 1, 2, 3

If errcase = 1 Then

If Cn.Errors.Count = 0 Then

Exit Sub

End If

End If

If errcase = 2 Then

Response = MsgBox(MsgConnUn, vbOKOnly, Title)

End If

If errcase = 3 Then

If Cn.Errors.Count = 0 Then

Exit Sub

End If

End If

For Each errLoop In Cn.Errors

Dim strError(5)

Dim i As Integer

strError(0) = "Error Number: " & errLoop.Number

strError(1) = " Description: " & errLoop.Description

strError(2) = " Source: " & errLoop.Source

strError(3) = " SQL State: " & errLoop.SQLState

strError(4) = " Native Error: " & errLoop.NativeError

i = 0

Do While i < 5

frmError.lstErrors.Items.add(strError(i)) 'Error is here lstErrors is the
ListBox

i = i + 1

Loop

frmError.lstErrors.Items.add("") 'Error is here lstErrors is the ListBox

Next ' Continue looping through ADO Errors collection.

' Create string for summary count of errors.

c = Cn.Errors.Count & " provider error(s) occurred."

' Display a count of the provider errors.

frmError.lstErrors.Items.add(c) 'Error is here lstErrors is the ListBox

'frmError.lstErrors.Items.add("") 'Error is here lstErrors is the ListBox

frmError.Show() 'Error is here

' Clear the ADO errors collection.

Cn.Errors.Clear()

Case Else ' Fall-through case statement.

Exit Sub

End Select

End Sub

Thanks

Dib
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Dib" <dN************@conNOSPAMsoftware.com> wrote
how do I call a form to open from another form.
Declare the form variable name before you use it, like you would
any other variable name....

Private Sub ErrorLog()

Dim errLoop As ADODB.Error

Dim frmError As New frmError
See if that helps....
LFS
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.