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





See Related Forum Messages: Follow the Links Below to View Complete Thread

Showing Another Form BEFORE The Main Form Is Shown
How do I show a Form before the main Form is shown? I need to show a LogIn form, and if input data is correct, procceed loading and then showing the main form. How to do it?

Regards,
President.

JPG On A MDI MAIN FORM
Hi. I have a MDI Appliction. I want to display a Picture on the Main MDI form, but i can't get it to work. Is there a way of doing this.?

Main Form
i have a program with many forms in it and everytime i click to go to a new form, the old form is still there. the new form comes up and is active but i don't want the first form to be showing. is this done in code?

Getting Value From Main Form
Hi again

I have on the main form some text boxes that load info from a db, no problem there, I can scroll though the data with a button and when the one I want is found I push another button that will insert this info into the form. so when I push the button it loads the form and gets the value from the main form with this

pid = Val(Trim(frmMain.txtFields(0))) // txtFields(0) is the id from the db

but it doesn't matter what value it is it always returns 1.

so if I was on the second id from the db it should send that to the second form but it sends a 1 everytime.

anybody have an idea?

TIA

One Main Form
I got more than 3 forms in my app.I want to make the main form disabled when form2loads and keep it like that untill the the form2 unloads what i am trying to say is how can you make a form a sub form
Here is the problem
when I load form1 from the main form I see two forms in taskbar Main and form1. I wand form1 in Main Form Like a Sub Form

Reconstruct Main Form
hi, here i have some problems:

1. i have 2 forms in my project, frmLogin and frmMain.

2. when the user LOGIN with the employee id, it will load standard toolbar, and explorer bar in the frmMain. and when the user LOGIN with admin id, then it will load advance toolbar and special bars in the frmMain.

3. Let say, now the user LOGIN with employee id, and on the frmMain, got another button which let the user to change the status of employee LOGIN to admin LOGIN. so, when he click the button, it will return to frmLogin to prompt for password.

the problem here: HOW do i unload and clear all my toolbar in frmMain when user return to frmLogin second time? as i know, if i put 'end' in my frmMain unload, it will end the application......so, if i did not put 'end', my application cannot EXIT when user click exit.....so, how to deal with this?

How To Change The MAIN Form?
I have an app with one form and lots of controls on it. Works great. Now I want to split up the controls, and place half of them on another form. I did this. Now how do I change the 2nd form I added to load first?

I have form1 and form2.

Form1 is the default main form I started with, and loads first at runtime.
Form2 is the 2nd form I added.
I want form2 to be the default, and load at runtime first.

Thankie!

Main Form Focus
is ther any way to keep the focus on the main form?
my program when something happens it pops up a textbox witht h information in it, but see evrytime that happens im in the middle on typing somethign on the main form and get interuppted buy the mssage form and text boz and i mistakenly type in the messge form textbox.
so... si there any way to keep the main form on focuz if another form in your project pops up or refreshes???

Must Have Startup Form Or Sub Main()
I'm trying to compile an ActiveX.EXE class. In my class I have a Private Sub Main(). When I compile, I get an error stating, "Must have startup form or Sub Main()." I've tried changing the "Private" to everything else, but it's still not working.

Any suggestions?

Main Form Won't Unload
My main form has a menu with a mnuFileExit_Click()
so that when I select File-Exit, all forms get unloaded from memory -- and everything is fine.

However, I'd like the same code to execute when I use the X box at the upper-right of the window (y'know, "X" out of the window).

So I'm assuming that what hitting the X does is fire off the Form_Terminate event. Thus, I use the below code:

Private Sub Form_Terminate()
Call mnuFileExit_Click
End Sub

But it doesn't work. It leaves the form in memory. Multiple executions of the program, therefore, leave multiple programs hanging around in memory.

Am I making the wrong assumptions about what the X button does -- and is there another way to do this?

Thanks.

Main Form Will Not LOAD!!!!
I have a module that is my STARTINg point in my program, It loads the Splash Screen, the main form,and then close the splash screen! For some reason It will not open the main form!!! It works on my computer but not a another HP Pavilion!! If I can fix this problem,I can start shipping this program!

My main form has a SSTab, Menu, and ButtonBar Controls, Could it be one of the OCX or an out of date file?

I have:
P200mmx with Windows 98a

the HP is:
Pentium with Windows 98?

Get Value From Subform To Add To Main Form
I need to get a value from my subform and add it to my main form when it loads. I have ran the below code and it is getting the value from the subform however it is not adding it to the main.

It appears that the form loads too quickly, as if i have a break in the code it shows that it is getting the value just not putting it into the main form. If i then re open the form the field has been populated.

Should it be in another section or is there another way to pull the value onto teh main form, any ideas?!!! Thanks




Code:

Private Sub Form_Current()

DoEvents

Me.txt_testmins = Me.sbf_charge_viewESummary.Form!txt_totalmins

End Sub

How To Deactivate The Main Form
There are two forms, Form1 and Form2. On Form1 is a command button named Command1.

Here's the code:

Private Sub Command1_Click()
Form2.Show
End Sub

This would make Form2 appear, but I don't want the user to be able to access the main form, Form1, while Form2 is on the screen. I don't want to use the Hide method to hide Form1, I want Form1 to still be visible, but unclickable. How do I do this?

Hiding The Main Form
I want to hide my startup form because I want to display my tray icon only. How can it be achieved??
I tried
me.hide()
me.showintaskbar=False

But it is showing error at Application.Run(mainform) in Sub Main()

Menu Of Main Form
Hi

I want to use popmenus in my child forms but I also want to use the menu from the Main form. How can I do this, whenever I create popupmenus in my child document the menu in the Main form disappears. Do I have to copy all the menu items from the main form in my child forms? or is there an other way

Access To Form From Main
Hi

I have written a VB program that starts from Sub Main. Sub Main is in a Module and Also I have a form in my project.

How can I access to my form and it's controls from Sub Main

Thanks

Bleed-through On My Application's Main Form
Hi - I have been having a VERY hard time with this and am hoping someone can point me in the right direction. Essentially I am getting bleed-through into my form from underlying applications (i.e. Mirc).

From some things I came across in my search for a solution it appears Clip Controls & Auto Redraw may or may not have something to do with it. Not knowing much about either, nor fully understanding the descriptions when looking them up in Help I just tried trial & error.

My form isn't anything spectacular.. I have a couple listview, some command buttons, a decent amount of picture boxes.. and well labels and stuff, but that's about it.

If anyone has any direction for me to look in I would greatly appreciate it.

At the very least maybe someone can fill me in on Clip Controls & AutoRedraw properties that are present on Pictureboxes & Forms.

Thanks!
Sterg

How To Disable The Main Form Picture...?
i accidentally push the picture property of the form i was working and put a picture and is shown left up inside the form...how i can disable it...or make the picture not visible? i dont speak about the control of picture i speak about the property of the form...form.picture.handle...it has these parameters...in vb 6...anyone help..

Communicating From Main Form To Control
I have a program doing calculations, basically its a circuit analysis program, i want that once the total resistance has been calculated the main form sends the total current to the custom control (where users input resistances) so that the control can also display current draw next to each resistor. How can i accomplish this... i don't know if public variables work from form to control?

Linking A Subform To A Main Form
Hi,
I'm new to VB and do all my stuff in access. I have wrote an application in access 2000 but now I want to start VB. I have a nice main form but I want to add a subform to display individual transactions from the main form. How do I link the subform to the main form so it shows data relevent to the data in the main form??.

Saltman

Pop Up Windows Stay Behind Main Form?
Hi Guys,

I wonder if anyone can help me,

I have a single form with some command buttons, when you click the command buttons they save and back up files, but say the files are in the backup location already, a small box pops to say the file exists overwright yes/no?

The problem I have is these little pop ups stay behind the form instead of being on the top, since VB generates these pop ups im not sure how to tell them to stay on top of the open form.

Any assistance is appreciated.

Regards
Colin

Code A Form_unload To Another Form Other Than Main?
i have my main form coded for the form_unload but i need to code certain actions to other forms when someone closes them.. how can i do it? it wont let me put form_unload in abother form so whats another option?

How I Can Hide Main Form From Appearing...
how i can hide the main form from appearing to the taskbar when i press a button?

Close Main Form When Another Closes
I have read through other posts I could find on this topic, but am still unclear. Here's the problem: In my program the main form has a button that opens a new form using hide/show. What I want to happen is for the whole program to end if the new form is closed. What would the code for this look like?

Thanks

Changing Display In Main Form
Thanks to all in advance,
Im new to VB and Im working on an application which has a rolling counter on the main form that basically displays the current line number being processed by the code. Im wondering what is the best method to display a rapidly changing text inside of the main form. The methods that I have used so far don't display anything until the code is completely finished with all of the lines, then it shows the final number. I tried opening a second, smaller, form over the first one that shows this information and uses CLs on that form just before updating the counter being displayed. From the sketchyness of the screen at that point I can clearly see that this is not the best way. I have been all through the VB help about every kind of display method and I just seem to be missing some little thing. Thanks again.

Defining A Startup Form Or Main Sub
Whenever I try to run my program an error message comes up saying that I need to define a startup form or Sub Main(), though I haven't had this problem before and up until now its ran fine. I don't know what I've done, so if anyone knows how to fix it, I'de be grateful!

Delaying The Loading Of My Main Form
Hello,

I am new in programming so this might sound like a stupid question to most.

I have a startup form that I would like to remain in the screen for 3 secondes approximately (just like in any application). I've tried using a mathematical formula looping several times through the records but it did not work in the sense that the startup form stays longer on the screen but is almost invisible.

Can someone give me an advice pls?
Thanks

How To Detect If A Key Is Pressed Outside Of The Main Form
I have a utility that runs but need it to detect keypresses no matter where the focus is. Is this possible.

At the moment I have a text box on a form and use this :-

Private Sub txtclick_Change()

What would I need to do to detect keypresses from anywhere?

Many Thanks for any help you can give.

Mabsey

How Ca I Put The User Company Name On A Main Form?
I would like to put the user company name on a main form any time the user run the program. But, the user have to enter the company name only the very first time he install the program.


Thank you for your patient

ERROR: Must Have Startup Form Or Sub Main()
Hello
I'm creating Picture Viewer and every time I click 'Preview' (Start), it says Must have startup form or Sub Main() then it opens a new window (Project Properties)


Here's my code:

Code:
Private Sub Form_Load()
Left = (Screen.Width - Width) 2
Top = (Screen.Height - Height) 2

Combo1.Text = "All graphic files"
Combo1.AddItem "All graphic files"
Combo1.AddItem "All files"

End Sub

Private Sub Combo1_Change()
If ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
Fiel1.Pattern = ("*.*")
End If

End Sub

Private Sub cmdExit_Click()
End
End Sub

Private Sub DirSelect_Change()

File1.Path = Dir1.Path
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")


End Sub

Private Sub DriveSelect_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
If Cmb1.ListIndex = 0 Then
File1.Pattern = ("*.bmp;*.wmf;*.jpg;*.gif")
Else
File1.Pattern = ("*.*")
End If

If Right(File1.Path, 1) <> "" Then
filenam = File1.Path + "" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If
Text1.Text = filenam

End Sub

Private Sub cmdShow_Click()
MMPlayer.FileName = Text1.Text

End Sub

Private Sub cmdShow_Click()
If Right(File1.Path, 1) <> "" Then

filenam = File1.Path + "" + File1.FileName
Else
filenam = File1.Path + File1.FileName
End If

Picture1.Picture = LoadPicture(filenam)
End Sub


What do I have to do? Please, help

Opening Main Form In VbModal???
I have a program with one form (non-MDI). The form is the "Startup Object". Is there anyway I can start the program where the form is in vbModal. I don't wish to use any API calls, ie; SetWindowPos.

Thanks

What Is The Best Way To Create Popups From Main Form
I want to create a popup which has 4 input boxes of which to provide me information. I have the form created, but I do not know how to open it (make it popup) and then close when OK is pressed. The form needs to have a Collection passed by reference in so I can add the data to it. Thanks ahead!

Deleting Background Of Main Form
How do I delete the background of the main form?

UserControl And Main Form **SOLVED**
Hey all,

is there a way to access functions from a User Control that are located on the same Form as the UserControl is?

For Example my MainForm contains a Public Function HelloWorld
My UserControl is located on the same form. How can I call the HelloWorld function?

Thanks Stephan

Link SSTab To Main Form
hi guys,

I am from ms access trying to use vb to create a database application.
pretty hard stuff i may add.., anyway..,

what i have is one main form, with an SSTab that has about 50 tabs on it.

Each tab will have a corresponding ID# that matches the ID# of the record on the main form., so, how do I keep the ID# linked from the SSTab collection to the ID# that is currently shown on the main form ?

thanks,
kevin

Main Form Should Stay In Taskbar But...
It isnt weather I do visible = false or .Hide

Create Forms In One Main Form
Hi,

how do i get forms to appear in one main form.......as you do in general windows applications?

Many thanks

Nick

Loading Forms Within Main Form
For a long time I have been wondering how to do this. I need to be able to load my forms inside one main form. If you open up microsoft word, or access, or any major program you will see what I mean.

Anyone know how to do this? Please explain or give a link to a site that explains.

Thanks a lot,
Ibn Mansur

Main Form Viewable While Processing
Hello,

Ok, here's the scene: This program has one form and loads 2 txt files into various sql tables. I have set up conditions to check that each txt file was properly loaded, which work fine.

The problem I'm having is that I can't get the form (as well as all controls placed on it) to appear while the program is processing. I'm trying to force the program to display as soon as the program starts and while it processing the txt files. Currently, the form only displays when the prgram finishes.

I've tried the MEs, SHOWs, and the BringToFronts...what am I goofing up on? If anyone could point me in the right direction I'd greatly appreciate it!

Thanks in advance

-Justin

edit: Ok, so all the processing is done in the form_load procedure, so that's gotta be it - Duh! *slaps head*
However, I'm still a bit hazy on how to fix it.

Opening A Form Within A Main Console
Hi I am wanting to write an application where I have a main window console for my application and any form that I open, is opened within the console. At the moment when I open forms they are floating forms. I want my forms to be witin a main console and if I try to enlarge the form it only fills the main console. which will then allow me me cascade two or forms within the main console. Is this possible and if so how can I acheive this?

A good example of what I want is MS WORD you can open more than one document within the main word console.

please help

First VB Program Without Using Any Form [ User Of Sub Main ]
Hello guys ,

I am vb learner and I have create the first VB program with using form myself

You can see it .

Code:Code:Public Sub main()
   MsgBox "Hello World !!!"
End Sub[/code]

Fly always to the SKY. You can do anything if you TRY. ;)

Getting Textbox From Subform Through Main Form
Hi, I was wondering if it's possible to get the text in a textbox on a subform, to use in a query, like this

Code:
[Forms]![frmMainForm]![SubForm].[TextBox]

DirListBox Causes Main Form To Be Disabled
This has become a serious problem for me. I have a simple example of the problem. On a form, create these three controls.
a DrivelistBox - drvLst
a DirListBox - dirLst
a FileListBox - filList

Option Explicit

Private Sub drvList_Change()
dirList.Path = drvList.Drive 'set new directory
End Sub

Private Sub DirList_Change()
filList.Path = dirList.Path
End Sub

Click on the drive letter in the dirLst box, and when executing just this simple scenario, the entire form is disabled(it shows enabled) and no events will occur-including closing the form, unless 1 entry in the directory list is selected. Note that the dir list scroll bar is even disabled until an entry is selected.

The above code was reduced down from my project code. This problem manifests itself in other ways too. The filelist is disabled until an entry in the range of entry nr 2 to entry nr 5 is selected. Any other entrys are not enabled!
What ever is going on here??.

I have attached the simple form that recreates this.
Any help out there??

Main Form Startup Position
I want to have the main form load up in the same position as when it was last shut down. I thought this would be easy, but alas it didn't work, hahaha....so...any ideas?

How Can I Dock SHBrowseForFolder In My Main Form?
Hey guys,

Could someone please tell me how I could keep the Explorer looking window (SHBrowseForFolder) in my main form? You know, so that it doesnt open a new browsing window but that it will always have a browsewindow open on the main form at all times. That way I can make it so that when a user clicks on a directory it will display the files in that directory in a filelist on the side. Any help would be appreciated. TIA.

5150

How To Process At Main Form While Continually Displaying Proceesed Data On New Form?
Hi,

I have a Main form in which all the processing is done, i would like to display the processed data on a new form (let's call it Display form). How do i continue to process my data on Main form while displaying new data on the Display form without closing the Display form?

Thanks!!!

Regards
Vivien

Display Form But Keep Executing Code In Main Form (think I Need A Splash Screen ..)
I've got a form which i have calling up a progress form. this form just has a label adn a progress bar on it. however, after i call up the form to be visible, i need to be able to keep executing my code in the main form, and simply update the progress form's progress bar and label. I think i need a splash screen, can someone point me in the right direction?

Open New Form Based On Main Form Primary Key (coding Issue?)
I am having trouble opening a new form with "child" data from my main form.

Basically I would press a button on my main form & want to open a new form listing the data based on a related key "txtFields(0)" from my main form

Here is my code on the "child" form - my main form button code is just "frmStudents.show"

Code:

Private Function initDatabase() As Boolean
    
    With SCGrid1
        cn.Open Adodc1.ConnectionString
        rs.Open "select * from Transactions where account = '" & frmMain.txtFields(0) & "'", cn, adOpenKeyset, adLockOptimistic
        Set .DataSource = rs.DataSource
        
    End With
    On Error GoTo 0
    initDatabase = True
    Exit Function
    
End Function



I call the "initDatabase" sub in the form load event of the "child"

I get a datatype mismatch error

Each Child transaction has a unique key of TransactionID & a joined field of AccountID, which would align with txtFields(0) from the main form.

Much appreciated,

Vwalla



Edited by - vwalla on 11/18/2004 12:21:20 PM

Accessing Data From One Form From Main Form In Visual Basic 6
How do I extract data from a form into the main form for processing? For
instance, I have several image files in a form called images(images.frm),
indexed from 0 to 99, and I want to import these into a variable array in my
main form, main (form1.frm). How do I code a control to get these images
into an array in my main form from the images.frm?

TIA

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