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




Initial Status When I Click On XXX.VBP


When I click on xxx.vbp, I see the Project window with a list of my forms and modules.

One of them is shaded, meaning it is the current active thing I am working on.

My problem is that the wrong one is shaded. I always have to click on the other one that I want.

How can I save my project so the item I am working on last is the active item the next time I open the project.

If this cannot be generally done, is there any way I can chose a project to be active by modifying one of the many VB component files?

Mr. Mac




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Trying To Split First Initial, Middle Initial, And Last Name/Suffix With Excel Macro
Hi,

I am a Data analyst for a average-sized pharmaceutical company. I have been assigned the task of creating a macro the separates names. I could use Text to columns on the column of names that need to be separated, but I only need the space before the last name to be separated. So, in Column A would be the Full name(ex: J H williams III). In column B, the first an second initials would be located(ex: J H). The last name and suffix would be in the Column C. When I record a macro and use Text to Columns, I find that I can't specify for the macro to skip to the last name(basically the next word with 2 or more letters) and split there. Does anyone have a macro that can do this. Below is an example of how the data looks and how I need it to work.


K R Russell IV

The data needs to be split into columns on the same row

K R in Column B

&

Russell IV in column C


Any help would be appreciated.

Dameon

Status Bar - Click Event
Can you make the panels within a status bar clickable? I have been playing around with it and just having hit on anything yet.

Thanks

Status Bar Panel(1) Click Event???
Is there a way to click on a status bar panel instead of click event of the statusbar


Code:
Private Sub stsbruserlog_PanelClick(ByVal Panel As
MSComctlLib.Panel)
MsgBox "you have clicked on the status bar", vbInformation
End Sub

Any hints..

Thanks in advance

Status Bar Panel(1) Click Event???
Is there a way to click on a status bar panel instead of click event of the statusbar


VB Code:
Private Sub stsbruserlog_PanelClick(ByVal Panel As MSComctlLib.Panel)MsgBox "you have clicked on the status bar", vbInformationEnd Sub


Any hints..

Thanks in advance

Help With Initial
the code like

Code:

Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub


when I use watch to view the value of num, it show the value is 0, why?

Initial Snapshot, Pt 2
HELP!! I STILL CAN NOT GET MY MERGE REPLICATION TO WORK.

I am trying to set up merge replication on my SQL Server db. I have set my machine up as Publisher/Distributor and the 'other' server as subscriber. I believe I have done everything including 'push' the subscription to the subscriber. The problem is that when I go into the Replication Folder under publications and look at the publication itself, it says that it's status is 'deactiviated.' Why did this happen and what can I do about it? I need to get this replication going. PLEASE HELP!!

Thanks!

Initial Value For Combobox
I can't get a combobox show a specific value on form load in "dropdown list" mode. It's OK in "dropdown combo" mode, I just use cboxxx.Text = "bla-bla" . In "dropdown list" mode it comes up with compile error, saying text property is read-only.

Set Initial State Of CheckBox?
Is it possible to set a CheckBox in Excel to be unchecked every time the workbook is opened?

My CheckBox reveals instructions for a user to follow - so I obviously want the text hidden each time they open the workbook.

Any ideas?

GH

Variables And Initial Values
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
three()
three()
End Sub

Sub Three()
Dim num As Double
lstresults.Items.Add(num)
num = 3
End Sub

When i run it i get the following in the list box:
0
0



can some1 explain to me why?
thanks

Retaining Initial Values
Hi,

I have a small problem that I can't seem to get around. I have a usercontrol that requires 4 variables to have preset intial values. I tried defining them as static variables in the usercontrol intialize sub, but once it reaches my sub that I am working in those values are destroyed. I tried delcaring in the main form as well as public and static, but the values never reach my sub. How can I get around htis? Thanks in advance!

Combo Box Initial Caption?
i've seen several how-do-i-make-selecting-options-in-my-combo-box-do-stuff threads, and a few how-do-i-add-options-to-my-combo-box threads, but haven't seen this one, am i a moron?

I want a dropdown listbox to have an initial caption, but the text property is read only and, although it doesn't show in runtime n e way, is auto set to the name of the combo box. before anything is selected in runtime, it is blank, haw can i give it a caption?

Initial Form Doesn't Appear
I'm certain that I'm doing something really stupid in VB6. I have a miniature application that I want to display a form for a short period and then go away. When I started building the application the form showed up just fine. Now it doesn't show up at all. I have set the Visible Property to True and I have included a Form1.Show and Form1.Visible to little effect. WHen I included them, the border would show up but nothing inside appeared and it appeared to be transparent. Help, this is incredibly frustrating.

TIA
-joe-


Code:
Option Explicit
-------------(General)---( Declarations)------------
Private Declare Sub Sleep Lib "kernel32" _
(ByVal dwMilliseconds As Long)
---------------------------------------------------
Private Sub Form_Load()
Dim Quote(500)
Dim Source(500)
Dim cnt
Dim RandomQuote
cnt = 0
Open "Quotes.txt" For Input As #1
Do While Not EOF(1) ' Loop until end of file.
Line Input #1, Quote(cnt) ' Read Quote & Source into arrays
Line Input #1, Source(cnt)
cnt = cnt + 1
Loop
Randomize
RandomQuote = Int(cnt * Rnd)
Close #1 ' Close Input file
Open "signature.html" For Output As #2
Print #2, "<font color=red><b>";
Print #2, Quote(RandomQuote);
Print #2, "</font><br>"
Print #2, "<font color=blue><i>";
Print #2, Source(RandomQuote);
Print #2, "</i></font></b>"
Close #2
Wait (6)
End
End Sub

-------------(General)---(Wait)--------------------------

Public Sub Wait(Seconds As Single)

Dim lMilliSeconds As Long
lMilliSeconds = Seconds * 1000
Sleep lMilliSeconds

End Sub

Initial Start Of Program
I am trying to write a VB prog and I would like for the user after installation, see the 'about box', then into a personal info box after closing about, then into a vehicle info box after closing the personal info. Once they have closed the above mentioned boxes, they will be looking at the main page of my program. I want these 3 boxes to show only once [at initial startup] but will be accessable anytime there after thru the menubar which I already have linked there.

Code I am using is:

Private Sub cmdOK_Click()
Unload Me
frmrv.Show
frmperson.Show
End Sub

It is apparently wrong, because it causes some code on the main prog not work work now.

Thank You

Browse Initial Folder
Any one noiticed that browsing initial folder code from some web site only works if user has selected the initial foder by themselves the first time?
and then it works because it was remembering what user selected the first time.

Text Box - Highlight Initial Value
I have data entered in a text box as a default value when the form loads, how do I have that text highlighted in blue (selected) when the form loads? I looked in the properties of the textbox but didn't see anything.

Hope this is an easy one, thanks!

CommonDialog Initial Path
Is there a way to force my common dialog to start in a certain directory?

My users will change it to another directory, but then not pay attention next time and it saves something in an unexpected spot (the last folder they used).

I could solve this by setting the path before opening the Save dialog, but am unsure how.

Any help is appreciated!

Thanks,

Seting Configuration Initial From VB
Hi

How do I configure my VB to be like the first instalation ?

Why each time that open my project the windows are hash in the form, How do I for let It Write ?

Printing Last Name With First And Middle Initial
I'm currently working a program that will allow the user to enter their last name, and first and middle initial. Here's my code:

begin
write('enter your last name: ');
readln(LastName);
write('enter your first initial: ');
readln(initialf);
write('enter your middle initial: );
readln(initialm);
writeln(LastName, ', initialf, ', initialm)
end.

When I run it for the name R.M. Jones, I get the following: Jones(for the last name), initialf(for the first initial), and M(for the middle initial). Can someone tell me what's wrong?

Initial File Directory With VB6
How can I set the initial direcotry for a file save dialog box to the users My Documents directory? For example C:Documents and SettingsSome UserMy Documents.

Set Window Initial Position
HI,

i have a mdi application and each childform has some textbox, when a make double click into it should be appear a dialog to select diferents items, but i cant achive that the dialog appears in the right botton corner of the text box.

please help meeee!!!


Thanx.

Initial Catalog Value Is Not Changing
Hi, In class module I have created public property procedures Data source name, userid , password and databse name. In a sample form I am assigning for value for that. Initial Catalog = Databasename. First time it is executed, Second time I changed the value for datasourcename and database name. While running the project, datasource name value is changed but initial catalog values remain same.
Can any please tell me the reason.

Setting The Initial State Of A Checkbox
Every time a user opens my workbook I want the CheckBox to be unchecked.

I can do this using a CheckBox from the Control Toolbox. I use this code:

Sheet1.CheckBox1.Value = 0

However, I'm having to use a CheckBox from Forms to ensure compatability with Excel 95 (ie not using Active X)

If I use this code to set the initial state of the checkbox to being unchecked then I get a "424 Object expected" runtime error:

CheckBox60.Value = 0

Does anyone know what the correct syntax would be?

Hope someone does - My Windows 95 client is expecting this by Saturday.

GH

Initial Values In Userform From Bookmarks
Hi all, I have created a userform for printing different pages of a word doc depending on which control the user selects. Now I'm trying to imporove this userform by setting initial values to the controls depending on different bookmarks in the word document. (The user shouldn't have to select this unless he doesn't want the default value.)

I got 3 controls in the userform named optAvtalLR optAvtalTB and optArb and my mission is this... if bookmarkLR = "x" then optAvtalLR = true elseif bookmarkTB="x" then optavtalTB=true else optArb = true

I can't get it to work properly I have tried several ways to write this code but no success... When bookmarkLR = x the userform is initialized ok and the optAvtalLR is checked ok, but when bookmarkLR doesn't exist and/or bookmarkTB = x the userform is not initialized at all ???

Can anyone help me out here? How should I write the userform_initialize code?
/Thanks
Carina

Preselecting Initial Row In ListBox With ControlSource
I have a UserForm with a ListBox set up to display a worksheet range as follows:


Code:
Private Sub UserForm_Initialize()
.
.
.
Me.Tag = "Initialization"
.
.
.
Set isws = isc.SourceWS
With isws
FirstRow = isc.SourceHdrRows + 1
LastRow = .Cells((65536), 1).End(xlUp).Row
Set ListRng = .Cells(FirstRow, 1).Resize(LastRow - FirstRow + 1, isc.SourceCols)
Set isc.SourceListRng = ListRng
sListRngAddr = ListRng.Address(External:=True)
End With
Set IndexRng = wvws.Range("ItemIndex")
If IsNumeric(wvws.Range("ItemIndex").Value) Then
ItemIndex = wvws.Range("ItemIndex").Value
Else
ItemIndex = -1
wvws.Range("ItemIndex").Value = -1
End If
With ListBox1
.RowSource = sListRngAddr ' triggers Change, not active
.BoundColumn = 0 ' triggers Change, not active
Me.Tag = "" ' activates Change
' Save the ListIndex in the WorkValues Sheet as ItemIndex
' must be set after BoundColumn, but first to allow Change event
sCtlSrcAddr = wvws.Range("ItemIndex").Address(External:=True)
.ControlSource = sCtlSrcAddr ' triggers Change, NOW active
.TextColumn = TextCol ' does not trigger Change
.ColumnHeads = True
.ColumnWidths = SetColumnWidths(isc.SourceISC.Widths)
'.MatchEntry = fmMatchEntryComplete
'.MatchEntry = fmMatchEntryFirstLetter
.MatchEntry = fmMatchEntryNone
End With
.
.
.
What I am expecting is for the ListBox to be displayed with the row indicated by ItemIndex "preselected" as a default choice (just hit enter and that row is used).

BTW, ItemIndex is actually the saved index of the last row selected from the previous time this range was shown in the ListBox.

However, the ListBox is always displayed with the first row outlined with a "row-cursor marquee" (i.e., the current row for movement with the cursor keys, but NOT selected). Running in debug mode confirms that ListIndex has been set to the desired ItemIndex value.

Why isn't the row selected?

Other than this initial state, the ListBox works as expected, using either cursor keys or mouse clicks to select various rows.

The ListBox has a Change Event macro that modifies a number of TextBox controls with values from the selected [source range] row. If the Add button is clicked, values from the selected [source range] row (and/or modified values from the corresponding TextBox controls) or used to update a target worksheet. In short, this dialog is used to select a row of values from a source worksheet to update a target worksheet.

Also, there is another annoying glitch in this process. The dialog has a button, which when clicked displays another dialog to select a different source range (actually a different source worksheet) for the ListBox on the initial dialog. This has the following event procedures:


Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Cancel = True
CommandButton2_Click
End Sub
Private Sub CommandButton2_Click()
' Use Job Type/Phase button clicked
.
.
.
' save Phase index name so it can be easily picked up for next
' display of item selection list
PhaseIndex = JobType & "." & PhaseName
.Range("PhaseIndex").Value = PhaseIndex
End With
Unload Me
End Sub
The problem here is that if I double-click to select a "Phase Index" (rather than click to select row and then click on "Use ..." button), I cannot suppress the click from being detected by the calling "Item Selection" UserForm, which usually winds up selecting an irrelevant row in the ListBox on the "Item Selection" UserForm. Of course, if I avoid the double-click (or if the location of the double-click does not correspond to a row in the "Item Selection" ListBox), it reverts to my first problem, NO row is selected.

Any ideas?

The UserForm.Tag property is used to flag whether the initialization of the listbox has completed enough for the ListBox_Change event procedure to initialize other TextBox controls on the form from the currently selected row. Ironically, when the ListBox_Change event procedure is allowed to run (after Me.Tag is cleared), it gets the correct value of ListBox.ListIndex to initialize the TextBox controls from the source row that I wanted to be selected in the ListBox, even though the row is not shown as selected.

Setting The Initial State Of A Checkbox?
Every time a user opens my workbook I want the CheckBox to be unchecked.

I can do this using a CheckBox from the Control Toolbox. I use this code:

Sheet1.CheckBox1.Value = 0

However, I'm having to use a CheckBox from Forms to ensure compatability with Excel 95 (ie not using Active X)

If I use this code to set the initial state of the checkbox to being unchecked then I get a "424 Object expected" runtime error:

CheckBox60.Value = 0

Does anyone know what the correct syntax would be?

Hope someone does - My Windows 95 client is expecting this by Saturday.

GH

Setting Initial Database Location
My VB6 app connects to it's Access 2000 database using a .ini file. Everything works fine in that respect. I can edit the file using a form, which saves the selected database location into the .ini file, etc....

My problem is that I haven't figured out how to set the database location upon the first use of the program. So, whenever the first form loads, it sees that it can't connect to the DB, and it shuts down. I know there was a thread on here posting something similar, but for some reason the method there didn't work for me. I can't remember, it was late last night.. ;-)

So...is there any way that I can have my application check it's DB connection, and if that connection is not valid, have it display my ChangeDBLocation form? I ask for that form instead of the normal CommonDialog, as I'm using it elsewhere in the program, and it calls the CommonDialog to select the location, and saves the selected file path to my .ini file. Not having to set up any of that again would be MUCH easier on me!

Thanks in advance to anyone with any ideas!

How To Change Initial Catalog Of Crystal9 Through VB6??
Everyone,

does anyone know how to change the Initial Catalog of Crystal Report9 by using vb6??

the scenario is that i change my database name then i cant run any report.. thus, the crystal report always look at the previous database.

thanks for your help..

How To Get Array Back To Initial State?
After I declare an array like

dim myArray() as integer

it is somehow 'there' but has no bounds or data.
how do i get it back to this state after I did for example

redim myArray(3)
...
redim myarray(0)
....

I tried setting it to 'Null' or 'Empty' or 'Nothing' all of which lead to error messages and nothing else.

Any way to do this?

thx,

Helger

Populating An Array With Initial Values
Does anybody know how I can assign a lot of values to an array at once?

in C I would do some thing like
int MyData[] = {1,1,2,3,7}

is there any way I can do something similar in VB?

Common Dialog Initial Directory
I am trying to add the Microsoft Common Dialog component, but everytime I click ok I get an error that says
"Name Conflicts with existing module, project, or object library"

Is there any way to fix this, or is there any other way to set the initial directory of the common dialog when it opens up?

Common Dialog Initial Directory
Howdy -
I am attempting to use the CommonDialog control to "force" the user to perform a Saveas before continuing.
The problem is that I want to set the default directory and do not seem to be able to . Does anybody know what I am doing wrong?? the section of code looks something like this

Dim StrNewFileName As String
Dim StrInitDir as String

CommonDialog1.CancelError = True
On Error GoTo ErrHandler

CommonDialog1.Filter = "Microsoft Excel Workbook(*.xls)/*.xls/"
CommonDialog1.Filename StrPropNum & "-" & StrCusName

StrInitDir = "F:SalesProposal"
CommonDialog1.InitDir = StrInitDir

CommonDialog1.ShowSave
StrNewFileName = CommonDialog1.Filename

At least this is the last attempt Ive tried things like,

CommonDialog1.InitDir = "F:SalesProposal"
CommonDialog1.InitDir = ("F:SalesProposal")
and so on, I am sure I am just not getting the syntax correct and would certainly appreciate any help yopu could give me.

THANKS!
Dave. K

Browse For Folder With Initial Directory
I have read the "Browse for Folder" article and it's good. But I want to show an initial directory (such as c:windows) when the "Browse for folder" appeared. How can I do ?

Thanks.

How Can I Change The Initial Startup Of A Group Of Forms?
I have three forms frm1, frm2, and frm3. frm2 was created first because it was the easiest. All forms are now complete. When the app is launched, I want frm1 to be my startup form. As it is now, the first form I created is the one displayed on startup. How can I change that? Thanks in advance!

Initial Startup Screen Size/position?
hi,

I've been running into this problem every once in awhile with my end-users.

The problem has to do with the screen size of my application the first time they launch it. I do save the last screen size and location upon exiting the program, but when they run the program for the first time, it obviously runs with the settings that were saved when I compiled the program.

I am using a 21" monitor with a 1024x768 resolution. I usually just make the main window small enough to view everything and keep it in the center of my screen when I compile it. But I guess customers with smaller screens or lower resolution are saying that my program is off to the far right of their screen when they first start it up.

So I guess my question is, what is the standard/accepted practice for the window size and position when you compile your programs?

Any help would be appreciated..

Dan

Option Button And Initial Values (RESOLVED)
I have an array of option buttons which set various constants values.
The problem is that when I open the form, although I can set my default option button to have value = true, i.e. so that it is selected, it does not automatically operate. I currently have to manually select an option button for it to work.




Edited by - jimvt on 6/20/2004 2:23:52 AM

RESOLVED - Common Dialog Initial Directory
How do I get the commondialog Initial directory to be
Code:cdl1.InitDir = Desktop
Thanks

andy99



Edited by - andy99 on 11/11/2002 9:04:47 AM

Unable Pass Initial Value To CDO's AddressBook Function
I'm trying to a function that takes a string containing a name and resolves the respective e-mail address through Outlook's GAL addressbook. To do this I make use of CDO's Session.AddressBook function. It's documented on MSDN that this function's first parameter is a recipients collection that provides initial values to the AddressBook's lookup dialog. However, when I try to pass this parameter I always get an invalid arguement error. Here's my code.


Code:

Dim mySession As MAPI.Session
Dim myRecipients As Outlook.Recipients
Dim myRecipient As Outlook.Recipient
Dim myMessage As Outlook.MailItem
Dim myApp As Outlook.Application
Dim sName As String

sName = "John D"

Set mySession = CreateObject("MAPI.Session")
mySession.Logon "", "", True, False, 0

Set myApp = New Outlook.Application
Set myMessage = myApp.CreateItem(0)

myMessage.Recipients.Add sName

'This always generates an E_INVALIDARG exception
Set myRecipients = mySession.AddressBook(myMessage.Recipients, "Select Name(s)", False, True, CLng(1), "Select", "", "", CLng(0))


I am completely stumped and have been looking for a solution for about a week now, so any ideas would be greatly appreciated. I have a feeling I am making a really obvious mistake so I'm hoping someone will spot it for me.

Thanks for the read,
-Chad

Help Please {Allow User To Bypass Initial Form, And Remember Setting}
Hi all,

I am working on creating an extension for a mapping software. What i am doing is, when the user opens the main form, it just says welcome and some departmental information and when they click enter they go to the mapping section(another form).

But, not always all the users want to have that main welcome page, so i just make it easy for them, such as, i had given a check box in that form and a message says that "Check here if you want to skip this main page when next time you open this extension".. something like that.

Is it possible to do like this in VB? This extension is going to be installed in everybody's machine, so once they click it, it shouldn't get displayed next time when they open it, instead it should activate the Enter button and open the mapping section.

can anybody help me please?

Thanks in advance,
P.Bagya.

Help: Locking A Program After A Specific Time After Initial Installation
Hi!!!
can anyone help me in coding this one in vb 6, im trying to make my program run in a specific amount of time after the initial installation like.. if i install my program on august 25, 2004 after 100 days it will will show a frm that say my program expires
hoping anyone can help thx a lot

Printer Status On/Off - Paper Status...for Any Printer Available On Machine
How do you find out the status of a printer that is available to the machine you are running your app on.

The Printer May be a network printer or a printer connected to this machine.
It may be connected thru a com/lpt/usb port...
It does not have to be the default printer.

Making Right-Click In A ListBox Select An Item Exactly Like The Left Click.
Heres a start:


Code:
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
'Place code to select the item
End Sub

I need help where the comment is. Thanks

Telling The Difference Between A OK Click And A Cancel Click On A Common Dialog Box..
When I load a mp3 file into my MMControl, it should then go and get the ID3 tags from it. But, I have a common dialog box so the user can specify what file they want to open. Now when they click the Cancel button it gives me an error because it's trying to get the ID3 tags from a file that blank filename.

To make a long story short: How do I tell when a user clicks the cancel button instead of the OK button on a File Open common dialog box.


Thanx,
Ben

Right-click Menu And Sending Left Click To Item
Can anyone tell me how I can use insert a right-click menu into my program so that when the user has selected a file (in a file list) and right-clicks, a menu appears at the location of the mouse pointer. I aleady know how to use the PopupMenu function to show a menu as I suppose that will need to be used, I just don't know how to capture a right-click mouse event and also use the position of the mouse pointer to show the menu.

Thanks in advance!

Single-click Vs. Double-click On Listview
Hey gang, can you help me on this one?
In my listview, if the user clicks an item, I basically don't want to do anything (the item that they clicked will be the current "SelectedItem" which can be used when needed).
However, if they double-click an item, I want that to act as a "shortcut" to an Update command.

Bottom line - how do I manage both single and double-click events?

Catching Right-click Or Double-Click In Excel
Hello,

What I want to do is open a VBA form (already developed and in my VBA project) when the user right-clicks or double-clicks a cell on a worksheet.

I cannot find any way to trap those events in MS Excel 97. I'm sure it can be done, any suggestions?

Thanks!

--Ben

How Do You Make The Mouse Click/dbl-click Outside Of A VB Form
How do you make the mouse click/dbl-click outside of a VB form, like on the desktop? In otherwords how can I make the mouse click on desktop icons and/or start menu applications?

Click Pic, Click Form, Pic Moves There??!!!
Hi, I know a lot of basic stuff about VB, but not complicated stuff, so whoever replys to this, could you please try to explain it as best as you can? Thanx a lot!
Well here's my problem...I'm trying to make a game that's somewhat similar to Command and Conquer. I want to click on a picture, it highlights and then you can click on another part of the form and that picture will move to that spot on the form! I have no idea how to do this, so please help me somebody! Thanx in advance!

On Click And On Double Click Events
hey i want my program to do a different event depending on whether you single or double click on something like a caption etc.

it seems that whenever you double click it it does what i told it to do in the double click but it also does wat i told it do in the single click event

can someone plz explain a way for me to clear this obstacle

thnx

Click And Hold Opposed To Click.
I've got a bunch of Image boxes....

When the user clicks on a box, the image changes to something else:


move mouse over image1
hold mouse button
release mouse button
image1 changes

move mouse over image2
hold mouse button
release mouse button
image2 changes


What I want to happen is have multiple images change when the mouse is held down and moved over them.

move mouse over image1
hold mouse button
image1 changes

move mouse over image2
image2 changes
release mouse button



Can this be done (I sure hope so!)

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