Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Menu Disappears In MDI Form


Hi Group
I have an MDI app with a number of child forms. One child form is loaded at
startup. When this happens the File Menu disappears in the MDI Form. If
the form does not load the File Menu remains. Can anyone explein why the
File Menu would disappear under these circumstances.
Regards
Phil Jones
The Logical Interface
02 9541 0367
www.logint.com.au
email@removed




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MDI Form, Menu Disappears
I have a MDI form with a menu bar, the form will load with no MDI child forms. The menu options will open particular MDI child forms. Whenever I open a form the menu bar from the Main MDI form disappears until the current MDI child form is closed. How can I keep the menu bar visible and active while using child form is open?

Thanks in advance.

MDI Form Menu Disappears When Child Loads
When my MDI child loads within the parent, the menu items disappear on the parent and become otherwise disabled, and the child's frm menu takes over.

Is there a way I can fix this?

Menu Through API Disappears
I'm Creating VB Menu at runtime from a table which has the menu items to be created. At Form Load Menu gets painted on the screen and is visible, once any other application or form is shown over the menu form, the menu disappears. My form is MDI form, i couldn't use paint event also. I would be thankful if any one helps me...

Ananth-India

Menu Bar Disappears
I am experiencing a wierd behavior from my MDI form. I have added 10+ forms in my project, All are MDI Child forms with BorderStyle of FixedSingle. I access these forms by their respective menu items located on a MDI form. All forms work nicely except two forms. When I try to access these forms, the forms appear, but the menu bar on the main MDI disappears. This bar remains invisible until I close the child form.
I am unable to understand this behavior, Is there something that I am missing?

Mdiform Menu Disappears
I've got a MDIForm with a menu on the parent itself. When I run the program, the menu is invisible (yes its set to visible and not changed anywhere in the code) but reappears when I close all the children forms but leave the parent open. Can anyone tell me why this is??

Menu Disappears When I Load An MDI Child...
I have an MDI form with a menubar at the top. When the form loads I show an MDI child form, but the menu disappears! I don't know what's causing this. When I make the MDI child non-MDI child, it's fine. Has anyone heard of this before?

-zSynopsis

Form Disappears
I am having a problem with one of my forms. Once I show it in a modal way, it disappears from my tab menu and from the task bar. The program is runnig and the form is loaded and once visible.. but if you change to another program... you cant find it anymore. Can anybody help me?

Form Content Disappears??
I have a VB6 program that works with the AS/400. You tell it to load the database files and it send a command to the AS/400 to create some files to be imported.

My question is that while the AS/400 is creating these files (multiple files and many records), the VB program sits and waits. If the screen saver comes on or you start something else over top the VB program, it removes the contents of the forms. The contents will not return until the control is returned to the VB program.

Is there a way to periodically refresh this screen while it is waiting?

Thank you for any help.

Form Icon Disappears
I have a form that has an icon in the upper left corner. When in design view, the icon shows normally. When I run the program in VB6 the icon changes to a little black box. I'm not sure how I got it to do this, but I can't figure out how to make it show the icon normally and I need my icon! Has anyone any clues?

Attached is the form code. It is probably something silly that I am overlooking. Thanks for looking.

Form Icon Disappears
I have a form with a flag icon for the form ico. When I run the program the place where the icon is supposed to be is a black square in the upper left corner. I havent seen this before and it has me puzzled. In design view the icon appears just fine. Anybody have any ideas?
Thanx in advance, Anthony

Form Disappears On Min Button
Hi Everybody,

I have forms placed inside an MDI form. When I use the "minimize button on any of the child forms the form will disappear from the MDI form space. (The form will be apparant only from the windows xp task bar)

How do I fix that so that the Minimize event will still show the icon within the MDI workspace?

Many thanks,
Paul

Form Disappears When Message Box Pops Up
Help?!

I have a main form that loads other forms on top of it.
If I set the other forms border style to "0 -None", when a message box pops up for that form, the form disappears until I select an option in my message box. After that it will display as normal.

Form Disappears But Program Still Running!?
here's code to a button that tests to see if the COM port has a functioning modem on it:

Private Sub cmdTest_Click()
On Error GoTo Eline:
'test modem
'close port 1st
If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.CommPort = cboPort.ListIndex + 1
MSComm1.PortOpen = True
MSComm1.Output = "ATDT 1-800-330-0428" + vbCr
x = MsgBox("You should be able to hear the modem dialing the phone line. Can you?", vbInformation + vbYesNo, "Modem Test")
MSComm1.PortOpen = False
If x = 7 Then
MsgBox "Select another COM Port and test it.", vbInformation, "Modem Test"
Else
Call cmdApply2_Click 'write to cfg
sbrStatus.Panels("Msgs").Text = "New Settings written! "
sbrStatus.Panels("Msgs").Picture = LoadPicture("c:ThorpeFormsEfiledataexc.ico")
Timer1.Enabled = True
End If
Exit Sub
Eline:
MsgBox "This is not a modem! Select another COM Port and test it.", vbExclamation, "Modem Test"
End Sub

When i test the program from within the VB project, all is well. However, when i compile it and then use this button, the code executes but the form disappears!! And if i hit ctrl+alt+del for a list of running programs, it is listed as still running!? can ANYONE tell me why this is happening and how i can fix it!?!?!

InProcess DLL Modal Form Disappears
Hi

I am writing a DLL that gets called by an application. This is a third party application, for which I have no code. This application for the most part runs as ActiveX (I think ) inside explorer browser

The DLL is developed as an activeX "InProcess" DLL in VB 6.0 (win32 unmanaged code)

My DLL throws some MODAL VB forms at users to capture some data and process it

What I observe is, that some times (it is reproducible, but not exactly sure how)when one of my forms is under display and an external event happens (such as an IM ping or email coming etc.), My form disappears and the app browser hangs.

My hypothesis is:
The external event causes App browser to assume control (for refresh and/or painting) and then it has no way to return control to my DLL (or even know that My DLL had control)

Questions:
1. IS the above hypothesis correct?
2. Is there any way of circumventing this problem (I have tried to play with keeping my window in top of other windows - but that does not solve this problem)

Please help

Matt

Toolbar Disappears After Form Activate
I added a toolbar to my app at the very end of development. Here's what happens: when the form is activated and while the form loads a listbox the toolbar and all buttons are visible, but as soon as the listbox is fully populated the buttons go invisible. I can click on where the buttons are on the form then they become visible, OR when I step through the program at the end of stepping the buttons remain visible, but when the program runs normally they turn invisible. I have checked all properties on the toolbar and buttons and they are all enabled and visible. The toolbar iteslf does not turn invisble, only the buttons.
I have tried forcing the buttons visible as the last line of code but it still doesn't work.

Can anyone point me in the right direction to solve this?

InProcess DLL Modal Form Disappears
Hi

I am writing a DLL that gets called by an application. This is a third party application, for which I have no code. This application for the most part runs as ActiveX (I think ) inside explorer browser

The DLL is developed as an activeX "InProcess" DLL in VB 6.0 (win32 unmanaged code)

My DLL throws some MODAL VB forms at users to capture some data and process it

What I observe is, that some times (it is reproducible, but not exactly sure how)when one of my forms is under display and an external event happens (such as an IM ping or email coming etc.), My form disappears and the app browser hangs.

My hypothesis is:
The external event causes App browser to assume control (for refresh and/or painting) and then it has no way to return control to my DLL (or even know that My DLL had control)

Questions:
1. IS the above hypothesis correct?
2. Is there any way of circumventing this problem (I have tried to play with keeping my window in top of other windows - but that does not solve this problem)

Please help

Matt

Highlight Disappears When Form Loses Focus
I have two forms, each with a text box. When I highlight text in one textbox, the highlight effect disappears when the other form gets focus. Is it possible to prevent this?

Webbrowser Control - Form Reloads/Disappears
Ok here's the problem. I've added a webbrowser control to a VB6 form. I load up a page post some data and wait for the user to push a command button. Everything works fine when I step through the code or set a breakpoint. However if I run the code w/o a breakpoint the entire form just disappears. It still shows up in the task manager. This is driving me crazy! Anyone have any idea?

Here's the code. If I set a breakpoint anywhere after the webbrowser.navigate everthing is fine.

Private Sub cmdApprove_Click()
    'Update
    bolSuccess = Approve()
    If bolSuccess = True Then
        'Ok to goto next record
        bolNext = True
        'Reload VT Page 1
        frmMain.WebBrowser.Navigate ("\Testcommonapps172130VT172130.htm")
        'Wait for page to load
        Do
            frmMain.MousePointer = 13
            DoEvents
        Loop While frmMain.WebBrowser.Busy
        frmMain.MousePointer = 0
    End If
End Sub




Edited by - argono on 9/26/2003 9:08:34 AM

2nd Form Disappears After 1st Form ".show"s It...
The Process: A user enters a search string on Form1 and hits "SEARCH". A "Searching..." image is displayed on Form1. Form1 gathers the results of the query and fills a FlexGrid on Form2 with the results. Then the code looks like this (code is in Form1)...

Form1.imgSearching.Visible = False
Form1.Hide
Form2.Show


The $*&($*& Problem: This problem only occurs when another program is running (such as an open PDF file...) Sometimes after Form2.Show is called, Form2 will appear for a split second and then "disappear". When I say Disappear, I mean it is not visible on the screen and the "PDF File" is displayed. The icon is still in the taskbar, and most of the time Form2 still has the focus, because I can scroll down the FlexGrid with the down arrow when the Form2 is still "invisible". I reiterate that this problem is only sometimes, and it's not predictable.

I'm wondering if it's (theoretically) possible that between the small amount of time that Form1 is hidden and Form2 is shown, can the "PDF File" become the new "Foreground Window" and therefore hide my application? I've tried to show Form2 first and then hide Form1, it's seems to help a little but I still get the problem occasionally....

Any thoughts/ideas?

Thanks!
Jason

Add Menu Item To System Menu Of Excel Imported Form [SOLVED]
I'm trying to achieve above 2 items but can't find out how. I've searched this forum already but also can't find anything relevant so am hoping that some of you might be able to kick me in the right direction.

I'm creating a combined VB6 and excel application. Basically VB6 controls excel. The forms used are imports from existing excel applications where I didn't feel like recreating them all over again. Part from that, the excel tab control is way better and easier to use then the VB6 one.

Progress timer:
When starting the program I want to show a progress timer because the program needs to initialize many items and arrays used. I thus created a simple progress timer which depending makes certain pictures visible which form a simple progress bar. The timer used is the VB6 timer option since there's nothing relevant like that from excel. This works well in itself but the problem is with display of the timer. During start it shows the form on which it was created but the timer only starts working after all has been initialized which basically defeats its purpose. Does anybody have any idea how to conquer this one.

Add item to top left window menu:
I want to add a About option to the top / left menu of my program window, the one also containing the minimize and maximize options. I've seen it done in other programs and since it is the only menu item I need I would prefer to do it this way also. I can't however find any information on how to go about this. Hope that someone can give me a push in the right direction for this one as well.

Thanks in advance for any suggestions.

Best regards,

Leon

Runtime Menu/Right Click Menu/No Border Form
Ok, I am trying to make a form as small as possible. I turned on the boreders and its just the way I want it. Now I would like create a popup menu (to save space, instead of puting command buttons). The problem is, when I add an invislbe menu in the menu editor and try to use Popupmenu, borders and the title bar appear on my form even though borders are still set to none.

From the search I did there seems to be no way to create a run time menu without some APIs. Is there any other way to accomplish a right click menu in this situation? Thanks.

Call The Save Method Of An MDI Child Form From The MDI Form Toolbar Menu Caused Error
Hi all,

This step-by-step article 818367 describes how to call the Save method in a multiple document interface (MDI) child form when you click the Toolbar button on the MDI Form.
However, execute statement <Me.ActiveForm.cmdSave_Click> ended up with error saying "Object does'nt support this property or method". Please advise and appreciated.

1. Start Visual Basic 6.0.
2. On the File menu, click New Project. In the New Project dialog box, click
Standard EXE, and then click OK.
3. In Solution Explorer, right-click Form1, and then click Remove Form1.
4. On the Project menu, click Add MDI Form.
5. In the Add MDI Form dialog box, click MDI Form, and then click Open.
6. Set the Name property of the MDI Form to frmMDI, and then set the
WindowState property to Maximized.
7. On the Project menu, click Add Form. In the Add Form dialog box, click
Form, and then click Open. By default, the Form1 form is created
8. Set the MDIChild property of the Form1 form to True, and then set the
Borderstyle property of the Form1 form to Fixed Dialog.
9. Add a command button and a text box to the Form. Set the Name property
of Command Button to cmdSave, and then set the Caption property to
Save.
10.To view the code editor, double-click the Save command button. Change
the Click event scope of the cmdSave event handler from Private to Public.
11. Repeat step 5 through step 8 two times. This adds MDI child form Form2
and MDI child form Form3.
12. Add the following code to the Click event of the Save command button of
the MDI child form Form1:MsgBox " Save event of MDI Child Form: Child1"
13. Add the following code to the Click event of the Save command button of
the MDI child form Form2:MsgBox " Save event of MDI Child Form: Child2"
14. Add the following code to the Click event of the Save command button of
the MDI child form Form3:MsgBox " Save event of MDI Child Form: Child3"
15. On the Project menu, click Components. Click Microsoft Windows Common
Controls 6.0, and then click OK.
16. Double-click the Toolbar control in the toolbox. Right-click Toolbar, and
then click Properties.
17. Click the Buttons tab in the Toolbar Properties dialog box, and then click
Insert Button to add a Toolbar button. Set the Caption property of the
Toolbar button to Save, and then set the Key property to Save.
18. Click OK.
19. To view the code editor, double-click the Toolbar to open in Code view.
20. Add the following code to the Click event of the Toolbar:
On Error GoTo NoActiveForm
Select Case Button.Key
Case "save"
Me.ActiveForm.cmdSave_Click
End Select
Exit Sub
NoActiveForm:
MsgBox Err.Description
21. Add the following code to the Load event of the MDI Form frmMDI to
show all the MDI child forms when the application starts.
Form1.Show
Form2.Show
Form3.Show
22. On the Project menu, click Project Properties. In the Startup Object
combo box on the General tab, click frmMDI as the startup object.

~Hiding The TitleBar Of A Form...or Making Borderless Form With MENU BAR~
hi
ive designed a form.. and now i want to make a slight change. im skinning it so i want no border for it. My form has a menu bar so the problem is i cant set to no border coz the menubar is present.. anyway i can hide title bar of a form?

thx

Form Making MDI Form Menu Disappear
One of my forms is making the menu from my MDI from disappear when its shown.

The form that is causing the problem, also has a menu on it, but I don't know why it would cause a problem now.

the problem seemed to show up after I was playing around with the toolbar and coolbar controls.
I've looked at every setting I know of, and I can't make the menu stay when this form is shown.

even setting the menu to visible in code doesn't help.
Any assistance would be greatly appreciated.

Form As Property Of Other Form + Dynamic Menu
Hello everyone,
this is urgent, any ideas welcome.
Ok, I have a form and user can type log in there. In the log he can insert a problem description and solution from database. He searches this in a different form.
Now what do I want? I want to pass the first form (log) as a property to the searchform.
So when the user clicks "Insert" I can insert the right things in the right log (more forms can be open on the same time of the log thingy). Any ideas on this ? Thank you!

Also just a little question, how do I make my menu Dynamic, so that it changes the possible options when I activate a certain form. Without typing all the visible things.

Thank you!
Greetz



Search before you ask - if you don't know where to search, ask before you search

How Can I Transplant A Complex Menu From This Form To The Other Form?
Suppose two form use the same menu. If I could copy some basic code about menu from this form to the other? Where can I find these code? Thanks!

Tab Contents Disappears
Would certainly appreciate some help with this!!

I have a form with 6 tabs on it using microsofts SSTab component. Now the problem...when I place another form on top of it, then hide that form, the contents of the tab disappear. You have to click on another tab, then back to get the information to reappear. I have tried refreshing with doevents, but it doesn't work. If I refresh in the immediate window, it refreshes and is visible, but when running the program, it doesn't.

Any ideas?

Thanks...TeeTime3

VBA Code Disappears Help!
After I create VBA Code in Excel 2007, it disappears. I create it, close VBA, return to Excel. However, when I try to go back to view the code, I get a blank VBA window. Any ideas?

MsgBox Disappears
This issue may be simple, but I struggle to solve this.

In my code I call a msgbox, which shows some message.

Some times msgbox behaves normal. But sometimes it appears and disappears in fraction of second.

Any Idea?

Image Disappears
Hello.

I have made some buttons of my own where i move using the Adodc.RecordSet.MoveNext/Previous/First/Last.

This is the code of one:


Code:
If Not Adodc.Recordset.EOF Then
Adodc1.Recordset.MoveNext
Else
Exit Sub
End If


I have connected an image with adodc. It shows me all the images when i move through the records but when i'm at the last record or first record and i press again the button, the image disappears. It's only a detail but i would like to know why it happens.

Any ideas?

DOS Window Disappears !
Hello all,

Pardon the lack of knowledge ---- whenever I run a VB or C++ program ( that I've previously compiled and linked) in Windows, the DOS window "disappears" after the program finishes running. I have to run the .exe files from a DOS prompt.

Is there a code that I can insert that will stop the program from exiting after running? I would like to have the .exe files runin Windows .....

TIA

My Listview Disappears!
I have a User Control containing a listview.
When I open an application which covers a form containing the Control, the listview doesn't redraw itself when the application closes (or is minimised). This only happens when the listview has focus.
Help! Any ideas?

Excel From Vb5 Disappears
I am trying to pass data from an array in VB5 to an excel spread sheet
This code works but th spread sheet closes back up. I want the user to be able
access the spread sheet and the return to my program. The Variables are arrays
that are variable length.

Private Sub Command1_Click()

Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")

ExcelSheet.Application.Visible = True
   With ExcelSheet.Application
   Dim myarray As Variant
    .Selection.NumberFormat = "0.00"
   .Range("a1:l" & LTrim(Str(Dataptr(1, 0)))).Select
   .Range("a1:a" & LTrim(Str(Dataptr(1, 0)))).Value = .Transpose(Shottime)
   .Range("b1:b" & LTrim(Str(Dataptr(1, 0)))).Value = .Transpose(Shotpos)
   .Range("c1:c" & LTrim(Str(Dataptr(1, 1)))).Value = .Transpose(Shearpos)
   .Range("d1:d" & LTrim(Str(Dataptr(1, 2)))).Value = .Transpose(Clamppos)
   .Range("e1:e" & LTrim(Str(Dataptr(1, 3)))).Value = .Transpose(Nitropress)
   .Range("f1:f" & LTrim(Str(Dataptr(1, 4)))).Value = .Transpose(Clamppress)
   .Range("g1:g" & LTrim(Str(Dataptr(1, 5)))).Value = .Transpose(Shotpres)
    
    Rangestr = "A1:L" & LTrim(Str(Dataptr(1, 0)))
    .Range(Rangestr).Select
   



   
  End With
ExcelSheet.Application.Visible = True

   

End Sub


    Dan S

 

Edited by - dsperry101 on 9/8/2005 10:29:53 AM

Txt Box Disappears - But It Shouldn't!
I have the following code in the tree view mouse down.
When I step through and reach the line
Code:txtGrade.Left = (frmGrading.Width 2) - (txtGrade.Width 2)
the text box disappears, and I don't know why!!!

I am trying to centre the text box regardless of the length of text in it.

Code:Private Sub tv1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

'...put users choice in the text box
Dim n As MSComctlLib.Node 'Since other object types may have nodes
Dim strTemp As String
Me.ScaleMode = 3

    Set n = tv1.HitTest(x, y)
    
    If Not n Is Nothing Then
        strTemp = "Grading syllabus for " & n.Text
        txtGrade.Width = frmGrading.TextWidth(strTemp) + (GetSystemMetrics(SM_CXBORDER)) * Screen.TwipsPerPixelX
        txtGrade.Text = strTemp
        txtGrade.Left = (frmGrading.Width 2) - (txtGrade.Width 2)
    End If
   
    Set n = Nothing
End Sub



Edited by - andy99 on 8/17/2003 7:25:37 AM

When The Checkbox Disappears...
i have a listview with chekboxes in a form
and when i launch the form, the checkboxes dissapear and i must click on it to recover them.
how can i solve this problem?

Formatting Disappears On Saving
if I save the contants of a rich text box to a text file all the formatting disappears,bold italic etc... why does this happen and how do i fix it

DrawString Text Disappears
I am using very simple DrawString code. The text displays, but after resizing the form, it goes away. Is there some additioinal call I need?

The code is something like:

Dim gr As Graphics = Me.ipInkPicture.CreateGraphics
gr.DrawString("This is a test", Font, Brushes.Black, x, y)
gr.Flush(Drawing2D.FlushIntention.Sync)

Program Window Disappears
Greetings!



The little app that I'm developing is acting a bit strange for some reason. Basically it completes the task and then disappears from view. When I minimize the remaining windows on my desktop I find that my app window is sitting right at the bottom of the pack. I have no idea which part of my code is causing the window to lose focus but what I am interested to know is if there is a VB command to eliminate this problem?



Thanks for your suggestions in advance.

MSHFlexGrid, Highlite Disappears
I am trying to return the value from a field in the grid when the grid is clicked, I have used both the SelChange and Grid_Click events to add code but in both instances the row is only highlited when you click then it dissapears (the variable is returned). What code do I need to add to get the row selected to highlite.

Private Sub MSHFlexGrid1_Click()

Dim lMouseRow As Long


' Set the grid selected by user to yes.
Grid_Selected = -1

lMouseRow = MSHFlexGrid1.MouseRow
'MSHFlexGrid1.Col = 1 *Causes Prob
'MSHFlexGrid1.Row = lMouseRow *Causes Prob
If MSHFlexGrid1.Clip = "ConnectionID" Then
Exit Sub
Else
If MSHFlexGrid1.Clip &lt;&gt; "" Then
'Grid_ConnectionID_Returned = CLng(MSHFlexGrid1.Clip)
End If
End If
End Sub

Ta Garry

Compiled EXE Disappears Completely!!!
Hi everyone!

Yesterday I encountered a very insane problem.
When I compile my VB project and click on a button to open a form, or when I click on a button on this form (the second one) my app disappears completely!

I have an error handler, I wrote MsgBox "1", MsgBox "2" statements on these two events, but no message at all!

I suspect that this is not an error regarding code? Perhaps something has gone corrupt? VB6 or my form?

This behavior occurs randomly however and NOT from VB6, only from the executable!

What on earth has happened?

Thanks in advance!

Highlighted Text Disappears
Hi,
I am coding a MUD client. The client has the incoming text stored in an RTF Text Box. Whenever text is highlighted, no cut or any command done, it disappears when you press enter. It also has this problem when you hit a button.

Thanks!

Popupmenu Disappears After 3 Seconds
I made a popupmenu in my project, but it disappears after about 3 seconds. Forms I've called with a command from the popupmenu also disappear.
My code is:

Sub Form_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
PopupMenu Splash.PopupBeeld
End If
End Sub

Can someone help me out?

Combo Box Text Disappears!
I have a combo box that's supposed to show all values in a given database. The procedure works fine until it gets to the end, then for some reason the combo box loses its text. The list items are there, it just no longer shows the item I selected. I ran a quick debug, and it happens right on the first Exit Sub (the one before the error handler.)


Code:
Private Sub MasterControl_Click()
Set fso = New FileSystemObject
On Error GoTo ErrorHandler
MasterControl.Text = Replace(MasterControl.Text, " ", "")
If fso.FileExists(App.Path & "Databases" & MasterControl.Text & ".mdb") = False Then
For i = 0 To MasterControl.ListCount
If MasterControl.Text = MasterControl.List(i) Then
MasterControl.RemoveItem i
End If
Next i
Set rs = New ADODB.Recordset
RecordSource = "SELECT * FROM Headers ORDER BY Name"
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "DatabasesHeaders.mdb"
rs.Open RecordSource, ConnectionString, adOpenKeyset, adLockOptimistic
If Not rs.BOF Then
rs.MoveFirst
End If
For i = 1 To rs.RecordCount
If rs!Name = MasterControl.Text Then
rs.Delete adAffectCurrent
Else
rs.MoveNext
End If
If rs.EOF = True Then Exit For
Next i
End If
OrganizerDatabase.ListItems.Clear
Set rs = New Recordset
Set Win32Script = CreateObject("WScript.Shell")
For i = 0 To Data.Count - 1
Data(i).Locked = False
Data(i).BackColor = vbWhite
Next i
RecordSource = "SELECT * FROM " & MasterControl.Text & " ORDER BY SiteName"
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "Databases" & MasterControl.Text & ".mdb"
Win32Script.RegWrite "HKEY_CURRENT_USERSoftware" & App.Title & "CurrentSelectedItem", MasterControl.Text
rs.Open RecordSource, ConnectionString, adOpenKeyset, adLockOptimistic
If rs.BOF = False Then
rs.MoveFirst
End If
For i = 1 To rs.RecordCount
If rs.EOF = True Then Exit For
OrganizerDatabase.ListItems.Add , , rs!SiteName
rs.MoveNext
Next i
Set fso = Nothing
Set rs = Nothing
Set Win32Script = Nothing
Exit Sub
ErrorHandler:
MsgBox "Error #" & Err.Number & ": " & Err.Description, vbCritical, "Program Error"
Exit Sub
End Sub

ListView Selection Disappears?
Hey, all. I'm writing to you from my kitchen counter as I pack other items for a move halfway across the USA!

I'm using the ListView control in Report mode. Whenever I delete a row:


VB Code:
lstFruits.ListItems.Remove 2


...The selection disappears. Granted, that same index (two) is still selected, but the visual indicator of its selected status is now hidden. So, if someone uses the delete button again, they have no idea what they're about to delete.

Is this a bug in the control? Is there a workaround? I have HideSelection set to False, so that's not it. Hmm!

As usual, thanks for your help. Much appreciated.

Access DB Password Disappears
VB Code:
CN.ConnectionString = "Persist Security Info=false;User ID=admin;" _            & "Data Source=" & App.Path & "dataProgramData.mdb;Jet OLEDB:Database Password=mypass"


ok I have a password protected database... and i connect via ADO like the above code..

that all works fine.. but I also use a reference to JRO to programmatically compact/repair the database...


VB Code:
jeCompact.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "DATAProgramData.MDB;Jet OLEDB:Database Password=mypass", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "DATABACKUPProgramData.MDB;Jet OLEDB:Engine Type=5;Database Password=mypass"


after I do this I delete the original DB file and copy the newly backed up one to the data directory so that the end user will now be using the compacted database file..

all this works fine but after the compact is done.. the database password gets lost, and users can just open the database in access... any thoughts on how to keep the password intact when doing this?

Combo Text Disappears
Hi All,

Here's a strange one. I have 2 combo boxes of the same type on screen. I also have 2 grids and the grids are bound to different ADO recordsets. When I select an item from one of the combos the recordpointer on the associated grid moves to the item where a column has the associated value and all is fine. I do exactly the same with the other combo and grid, but after the recordpointer has moved on the grid, the value in the combo disappears. When stepping the code at the 'End Sub' line of the combo's click event the correct values are still in the combos text property. As soon as I F8/F5 off, the text disappears. I've removed and replaced the control, put debug statements into every event incase somthing else is triggering and nothing is.

Excel Sheet Disappears
I am trying to pass data from an array in VB5 to an excel spread sheet
This code works but the spread sheet closes back up. I want the user to be able
access the spread sheet and then return to my program. The Variables are arrays
that are variable length.

Private Sub Command1_Click()

Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")

ExcelSheet.Application.Visible = True
   With ExcelSheet.Application
   Dim myarray As Variant
    .Selection.NumberFormat = "0.00"
   .Range("a1:l" & LTrim(Str(Dataptr(1, 0)))).Select
   .Range("a1:a" & LTrim(Str(Dataptr(1, 0)))).Value = .Transpose(Shottime)
   .Range("b1:b" & LTrim(Str(Dataptr(1, 0)))).Value = .Transpose(Shotpos)
   .Range("c1:c" & LTrim(Str(Dataptr(1, 1)))).Value = .Transpose(Shearpos)
   .Range("d1:d" & LTrim(Str(Dataptr(1, 2)))).Value = .Transpose(Clamppos)
   .Range("e1:e" & LTrim(Str(Dataptr(1, 3)))).Value = .Transpose(Nitropress)
   .Range("f1:f" & LTrim(Str(Dataptr(1, 4)))).Value = .Transpose(Clamppress)
   .Range("g1:g" & LTrim(Str(Dataptr(1, 5)))).Value = .Transpose(Shotpres)
     
    Rangestr = "A1:L" & LTrim(Str(Dataptr(1, 0)))
    .Range(Rangestr).Select
    



    
  End With
ExcelSheet.Application.Visible = True

    

End Sub


    Dan S

 

Edited by - dsperry101 on 9/8/2005 10:29:53 AM



Edited by - dsperry101 on 9/8/2005 11:40:29 AM

Statusbar Disappears While Colorizing
Hello again
I made sure that no controlls are being displayed over the status bar, however when I colorize my richtext box the status bar disappears. ( I am using Dekes colorize method)
I tried setting the StatusBar ZOrder to vbBringToFront and that has no effect.
Anybody have any Ideas
thanks

Excel Sheet Disappears
I'm running some vba code that is working with several large worksheets...the code can take several minutes to complete. Sometimes the workbook the code is running in just disappears and all I see is the gray background of excel. Once the code is done, the active workbook does reappear and everything is fine. During the code execution I have ScreenUpdating set to false.

Anyone know about this and how to stop it?

Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved