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




What Is The Code To Quit My Program I Created?


I just finished building my application that I built in VB6. I have an Exit button on the main form that unloads the main form. I have Unload me code already. What is the line of code that ends the running of my code?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Created A Program.. Need Code To Be Verified.
I created a program to keep track of my DVD Collection. I typed out all the code. however, somehting must be wrong! when i insert a DVD title, it get's stored to my external textfile. But when i run a search for that title, nothing come up. If anyone wants, i can also upload my VB Project.

Here's my Code:

Code:
Option Explicit
Private Type Employee
Title As String
End Type

Dim SearchResultWindow() As Employee
Private Sub cmdInsert_Click()
Dim Title As String

Title = txtTitle

Open App.Path & "dvd.txt" For Append As #1
Print #1, Title
Close #1
'Clear Textfield
txtTitle.Text = ""
End Sub
Private Sub cmdSearch_Click()
Dim i As Integer
Dim tempStr As String, tempArr() As String
Dim match As Integer

Open App.Path & "/dvd.txt" For Input As #1
tempStr = Input$(LOF(1), #1)
Close #1

tempArr = Split(tempStr, vbCrLf)

ReDim SearchResultWindow(UBound(tempArr) - 1) As Employee

listResults = vbNullString
For i = 0 To UBound(SearchResultWindow)
match = 0
With SearchResultWindow(i)
'------Check Title----------
If Len(txtSearch.Text) > 0 Then
If InStr(1, .Title, txtSearch, vbTextCompare) <> 0 Then
match = match + 1
End If
Else
match = match + 1
End If
'---------------------------------------
'------If all criteria match, add record---------------
If match = 1 Then
listResults.AddItem .Title
End If
'-------------------------------------------------------
End With
Next
End Sub

Private Sub mnuClear_Click()
txtTitle.Text = ""
txtSearch.Text = ""
listResults.List = ""
End Sub

Private Sub mnuPrint_Click()
Printer.Print listResults.List
Printer.EndDoc
End Sub

How To Quit Program From Ocx
First of all, I like to say a billions of thanks to Mr. Gruff. Because he was helped me to much..

Before this, I have posted for "How to put FSCommand inside ocx" title forum.
Now it's done.. Thanks Mr Gruff.

For this forum, I like to ask everyone how to quit program from ocx.
My script is:

If command = "quit" Then
End
End If

When I compile it, there got an error "Functionality not supported".
How to solve this problem..

TQ

Quit Program
hello,

The user of my application has the choise of using the menu (file=>quit) or the X button to close the program. I just want to know if i use a correct method. I first didn't put anything in the unload event, but then all the object would still be open?

Now this is how i do it now :

Code:

Private Sub mnuClose_Click()
Unload Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
adoCn.Close 'close the database connection
Set adoCn = Nothing 'set my object to nothing
Set adoRs = Nothing
Set frmResizeDF = Nothing
End Sub

Thanks

Program Doesn't Quit.
I am running a small vb6 exe in a minimized window. It is called from another application, performs it's task and quits.

On my computer it works fine, but on my client's computer the program won't quit unless the window is maximised from the taskbar by the user. Both computers run windows 2000.

I only sent the exe file to my client, no intall program and no other files. Could that be the reason it won't quit? Everything else in the program works fine.

Here is my main procedure code:

Private Sub Form_activate()
readSetup
If Len(Trim(Command$)) &gt; 0 Then
form1.requestFile.Text = Command$
getRequest
getLicence
sendResult
Unload Me
End
Else
MsgBox ("You must pass the name of the input file in the command line.")
Unload Me
End
End If
End Sub

How Can I Quit A Program Without Using UNLOAD Command
Hello,

I have 2 forms. Form1 and Form2. Form1 calls form2 (form2.show vbmodal). In form2 in the Form_Load sub after checking a condition I want to come out of it without even displaying the form. Now if I use Unload Me then when the control returns back to Form1 I get an error "Object was unloaded".

How can I come out of the FORM2 program gracefully so I don't get any errors?

Please help.

Thanks in advance.

Quit A Program Before Startup Form Is Loaded?
In my form initialize, i check to see if a certian program is running. if it is, i put a pessage saying "you cant run this exe while that one is running. quit it then press ok",

if they press OK it rechecks for the other program and posts the same message
if they click cancel, i Unload Me..

only thing is.. it seem we cannot Unload Me in Form_Initialize, because Form_Load hasnt run yet...

so how to quit this program?

Program Wont Quit On Label Click Event
hey guys I have a label that caption says exit, but when I click on it, it does nothing.

Here is the code for it..


VB Code:
Private Sub Label90_Click() 'boAbort = True Call UnloadAllForms(Me)End Sub


???

Is there something I missed? Thanks!

Using Own Created Dll In Program
I am working on a Direct3d engine and first made it in an active x usercontroll but now want to use a activeX dll ... how can i make my program use the dll?

also what should i do to call a sub etc etc :S any help will do



can i use it as a refrence? or something ?

VB6 Created Program Will Not Run In XP
I created a program using VB6 under WIN 98. The program uses an ado
database.
When I use the package and deployment program in VB6 on this program
and then install it on a machine with XP Pro on it, I get the Provider
can not be found error..

Any Ideas....I Hope

What OS's Will Program's Created In VB Run On?
If I package up my application into a distributable/installable file what OS's will it run on?
And will it be possible to run on Mac's? Even if I have to include plug-in's etc??

Thanks

Opening In Created Program??
Well guys,
Let's see if you got an anser on this one.

I want to save a file with te info I filled in textboxes!!
I know i can do that!!
I can write and save it in an txt file.

But now it commes:
When i click this saved file, i don't want to open in the notepad from windows, but i want it to open in my program!!

How do I do that??

Greetingzzz Cybercool, the one and only!!

Help With Packaging The Program Created
Hi,
I have just created my program and would like to turn it into some kind of self installing program but not sure I can.

My program has a directory full of images, a .dll file from wich it uses a number of functions so it has to be in the same directory as the executable file, it uses the "Microsoft Internet Transfer Control" and also has a reference to "Microsoft Scripting Runtime" plus an .ico file which I would like to use for the executable files.

The problem is that I do not know how to include the images in the "Package and Deployment Wizard". Also I do not know how to change the icon for all of the executable files to my icon.

I tried to use a resource file but the option is not available in my Add-in Manager and I do not know how to create one manualy nor do I fully undestand it.

Thank you for any help.

Shutdowning Via A Program Created By VB6 0
What can I do if I would like to create a program which call a dll of windows NT without calling a .exe or .bat program but using a DLL like "user32","Kernel","rundll32"...
Would you like to help me?
Tsiry
(04/12/05)

I've Created A Font Program
How can i make my mnuFont_click() pull up the Font Program i created

Program Error ( *.exe Has Generated Errors...restart Program.... Error Log Created...
I have a VB Application in Production for last 4 yrs and in last 2 weeks the users were getting this error.

Error Message Window Header: Program Error

Actual Error Msg: [My program name].exe has generated errors and will be closed by windows. You will need to restart the program. An error log is being created.

Buttons: Cancel

This error is happening randomly on different machine(all machines have same image) on random Screens.

I have not seen this error yet on my development workstation.

Any help will to fix this will be greatly appreciated.

Thanks
SPJ

Option Menu For Program Created In Vba
I need answers to two questions. Please pardon if this can be found in the forum but I searched for a while...

My program saves the excel document into a hardcoded folder string. I need to give the user the option to change the default save folder, I thought an options menu would be the best way to implement this. I don't really know how to create the menu but I'm sure I can figure it out. My biggest question - how do I get the changes that the user makes to stick after the program and Excel has ended? I of course don't want them to have to change it everytime they execute the program.

i.e.,
default = "c:Documents and SettingsuserMy Documents"
user preference = "h:Excel Documents"

If you have a few minutes and if you know any good threads/documents detailing on how to do this and how to create the menu, it would help immensely!

Let me know if my explanation isn't clear.
Thanks in advance,
Aaron

Determining When A Window Is About To Be Created By Another Program
Hi all. I've searched this forum, and countless others to determine if the answer to my question exists in an understandable form. All attempts failed; therefore, I am posting my question here in hopes that someone will be able to provide an answer.

I am attempting to determine when a window is about to be created by another application, so I can alter its starting position, and possibly its size. I am also attempting to prevent focus from ever being given to a certain window. In both cases, the window will be sourced in an application not my own (ie. it will already be running when my program starts, or will start running afterwards).

I have looked into using a Hook to hook onto the application I want to modify, or to the system to intercept messages; however, in every place I looked it said something about needing the call to be placed in an outside DLL because it can't be done directly from VB. I have no idea how to do this, can anyone help in this area? Any suggestions, methodologies, or code will be greatly appreciated.

Thanks.

Determining When A Window Is About To Be Created By Another Program
Hi all. I've searched this forum, and countless others to determine if the answer to my question exists in an understandable form. All attempts failed; therefore, I am posting my question here in hopes that someone will be able to provide an answer.

I am attempting to determine when a window is about to be created by another application, so I can alter its starting position, and possibly its size. I am also attempting to prevent focus from ever being given to a certain window. In both cases, the window will be sourced in an application not my own (ie. it will already be running when my program starts, or will start running afterwards).

I have looked into using a Hook to hook onto the application I want to modify, or to the system to intercept messages; however, in every place I looked it said something about needing the call to be placed in an outside DLL because it can't be done directly from VB. I have no idea how to do this, can anyone help in this area? Any suggestions, methodologies, or code will be greatly appreciated.

Thanks.

VB 3.0 Created Program Crashes Windows ME
I have a simple 900Kb program in Visual Basic 3.0 that I gave to a friend who has Windows Millennium. It appears to load but the computer crashes. On restart it says "improper shut down detected" and runs scan disk for errors. The program is in a self extracting setup.exe file that places vbrun300.dll in the window system directory and puts the main program in a directory of its own under program files. Is the problem that I am using 16-bit VB 3.0? If so, what vb versions can I switch to that will import my vb3.0 files? Thanks

Why Are .TMP Files Created Every Time I Run My Program?
I have created a program that allows a user to select up to 6 keywords, from 6 combo boxes. Based on the selections made, and SQL string is constructed and uses as a recordsource for an ADO data control. This works well except that each time I carry out a search a bunch of .TMP files are created and in no time at all I have an out of memory error.

What can I do to prevent these files being created.

any help appreciated

Can U Add Code To Objects Created On The Fly?
can u add code to objects created on the fly?

For example if i run the following code then i want to run some code if a command icon is clicked.

Static X As Integer
X = X + 1
Set Commandbject = Me.Controls.Add("VB.CommandButton", "CommandButton" & X)
With CommandObject
.Caption = "Name"
.Top = 500
.Left = 500
.Height = 500
.Width = 500
.Visible = True
End With

MSHFlexgrid Created In Code
I want to be able to declare the recordset of an MSHFlexgrid in code. I have tried
<pre>flexgrid1.recordset = SomeRecordset</pre>
but I keep getting the dreaded block set error! I know the recordset is good because I have tested that. There is data there. The grid just doesn't like it.

Any ideas?

Thanks,
Eva

Can U Add Code To Objects Created On The Fly?
can u add code to objects created on the fly?

For example if i run the following code then i want to run some code if a command icon is clicked.

Static X As Integer
X = X + 1
Set Commandbject = Me.Controls.Add("VB.CommandButton", "CommandButton" & X)
With CommandObject
.Caption = "Name"
.Top = 500
.Left = 500
.Height = 500
.Width = 500
.Visible = True
End With

Return Code For Exe Created In VB
I have aproject which is a simple exe project. I have another program in C## launching this VB exe. I want to communicate to the C## program that when my exe encountered any internal error or not while executing.

How do I do that. One way is to write to file and C## program can read the file for the error.

But is there a generic way of exiting the VB exe and returning a status code of -1 or something.

What happens if my VB application comes across a run-time error and exists. What is the return code given back to the calling program.

This is Very Very urgent. Any help will be greatly appericated.

Thanks!

How To View File Created And Written By VB Program
Hi,
Please help....
I have a read a file containing strings and numbers into an array and have modified the array during run time. Further I also saved the file as a new file while the program is running.
However my problem occurs when loading back the same modified file while running the same program.... that is ....it load the same original file and not the modified version.
If have figured out....that I have to close/exit the program which is running and re-run the program back again....and when I load the modified file... i load correctly.
How is it possible to load the program without exiting the program..

Your replies would he highly appreciated

Program Hangs When Trying To Read Self Created File
I'm still working on that information program for my computer science course (and ive made it far better then what was to be expected) and ive run into a hiccup. i used code given to me from another member of these forums (Philly0494) to detect if a file is missing, then create it if it is missing. the code works flawlessly, and the thread i got it from is HERE.

but when the new file is created and i click the retrieve button again, (it should display a message saying the file is empy and aask you to fill in information and save first) the program hangs at the loop that reads the file, it never hits end of file and i dont know why. the number enver changes from 1. but yet, if i close the program and restart it (meaning the only difference is the file wasnt created that time) then the code runs through properly. im so confused by this. ive included the program below for you to check out and test. in order to get the results you have to delete the info.txt file in the application directory, then click retreive twice.

Program Created In Windows XP Not Working In 2000
Hey everyone,
i've completed my program at last, its all good and i've learnt some basic VB stuff now.

Anyways, I seem to have a problem. I have used the application and deployment wizard to create a setup and I put it on disk (created this in XP). I then put the disk in a Windows 2000 computer and it goes through the motions, but then I get something like following message:

"the files on your system are out of date, would you like to install the updated files. You must restart to continue installation."

I get some sort of message like the above. But when I restart and try and run the setup again it just gives me the same message. I have looked in the temp folder and notice that 3 of the .dll's appear there along with the program files, but the rest of the dll's seem to not be there.

I'm guessing that the first step of the setup is to copy the dll's, hence the other dll's have already been copyied. But then it stops because it cannot copy the other dll's and puts all my program files and the remaining dll's in the temp folder?.

I have also tried deleting the folder within the temp folder and checked autoexec.bat (autoexec.bat is empty).But whatever I do it just doesnt work. Now i'm starting to think that its something to do with the 3 dll's in the temp folder and compatibility with Windows 2000.

Any ideas would be greatly appreciated, thanks (* I will just go and find out what the dll's are, might help)

How Do I Back Up The Registry Files Via VB6 Created Program
I have found where the reg files are located via the Hive key found in the registry, but these files are locked and they prevent me from copying them. I need to find away to back them up via VB6. I know there must be a way as there are expensive backup software programs like Veritas that can do it. If anyone can offer any suggestions as to how to go about doing this via VB6 code I would be very grateful.

I would be happy if there was a way to automatically make a restore point and know where the files are saved, then copy the files from the restore point area for backup to a safe place incase the HD fails or the Reg. is corrupted.

Thanks,

Ralph

How To Name Lines Created By Code Statements ?
hello ,
if I've created some lines by code , how can I give them names, and how can I copy a line by code statements .
thanks

Dllregisterserver In &lt;DLL WE CREATED&gt; Return Code Was: 0x80004005
My friend is writing a plug in for Corel Draw. The problem is that the code installs and works just fine under Windows 2000 but the install chokes on Windows 98 when it tries to register a dll that he wrote.

dllregisterserver in <DLL WE CREATED> return code was: 0x80004005

Any ideas? I told him to come on here and post a question as many of you give insightful technical answers, not the run-of-the-mill "reinstall windows". (which has already been tried on multiple machines)

-Jim

Create Code Behind Dynamically Created Button
I have found numerous different ways to add dynamically generated buttons to a form (i.e., during runtime). However, how do I dynamically generate the code behind these buttons?

Thanks in advance!

Adding A Code To Created At Runtime Object
Private Sub Form_Load()
Dim newbuttond As CommandButton
Set newbutton = Form1.Controls.Add("vb.commandbutton", "cmdButton", Form1)
With serge
.Top = 200
.Width = 2000
.Height = 900
.Left = 300
.Visible = True
.Caption = "Hi there"
End With
End Sub


i got this code to add a button at runtime but how do i add lines of codes to it

Retrieving DSNs Created On Remote PC With VB Code
Hello everyone
I want to retrieve the list of DSNs created on the Remote PC (connected on LAN) through VB code.
I cannot use any tool for that and i must do it using VB 6 code.
Plus i don't want any code and installation on that Remote PC whose DSNs are to be accessed. All coding must be on local PC.

I have retrieved the list of local DSNs by using following code but unable to retrieve DSNs remotely.

Dim odbcTool As New ODBCTool.Dsn
Dim Dsn() As String, i As Long
If odbcTool.GetDataSourceList(Dsn()) Then
' a True return value means success
lstDataSources.Clear
For i = 0 To UBound(dsn)
lstDataSources.AddItem dsn(i)
Next
Else
' a False value means error
MsgBox "Unable to read DSN list", vbExclamation
End If




Thanks in advance

Write Code For A Created Window - CreateWindowEx
I have been trying to figure out how to write event code for a button that was created from a sample project by allapi.net. AllApi has a sample program at the bottom of this page http://www.mentalis.org/apilist/CreateWindowEx.shtml called "New Start Button". This sample app uses CreateWindowEx to create a window and return the handle of that window. I would like to write event code for that new control that was created. How would I go about doing this?


Here is the code from that link above:


VB Code:
Const WS_CHILD = &H40000000Const WM_LBUTTONDOWN = &H201Const WM_LBUTTONUP = &H202Const SW_HIDE = 0Const SW_NORMAL = 1Private Type RECT    Left As Long    Top As Long    Right As Long    Bottom As LongEnd TypePrivate Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongPrivate Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As LongPrivate Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As LongPrivate Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As LongPrivate Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As LongDim tWnd As Long, bWnd As Long, ncWnd As LongPrivate Sub Form_Load()    'KPD-Team 1998    'URL: [url]http://www.allapi.net/[/url]    'E-Mail: [email]KPDTeam@Allapi.net[/email]    Dim R As RECT    'Get the taskbar's window handle    tWnd = FindWindow("Shell_TrayWnd", vbNullString)    'Get the start-button's window handle    bWnd = FindWindowEx(tWnd, ByVal 0&, "BUTTON", vbNullString)    'Get the start button's position    GetWindowRect bWnd, R    'Create a new button    ncWnd = CreateWindowEx(ByVal 0&, "BUTTON", "Hello !", WS_CHILD, 0, 0, R.Right - R.Left, R.Bottom - R.Top, tWnd, ByVal 0&, App.hInstance, ByVal 0&)    'Show our button    ShowWindow ncWnd, SW_NORMAL    'Hide the start button    ShowWindow bWnd, SW_HIDEEnd SubPrivate Sub Form_Unload(Cancel As Integer)    'show the start button    ShowWindow bWnd, SW_NORMAL    'destroy our button    DestroyWindow ncWndEnd Sub

Can A Datacombo Have Rowsource As A Recordset Created With Code
Hi

Can you assign a recordset created by ADO code to a datacombo box? I tried with "datacombo1.RowSource= reordset1", but it does not work.

Can somebody please tell how to do this?

Thanks

balajee

Code For Events Of Dynamically Created ComboBox
Need an help to code events for the dynamically created combobox in VB. As the combobox is created and filled with data at runtime, now if we want to access any event of this combobox how to code for that event. Please if anyone can help me out ..... Thanx

Adding Code To A Dynamicaly Created Object
I know how to create a object in run-time. (Using the load statement) However this is not yet enough. Is it possible to create code in the dynamically created object. For instance use the call statement to use sub's in other forms/objects.
Or is it possible detect an event in the created object from within a base form. Something like if form1.NewObject = clicked then call sub1

Assigning Icon To Custom File Extension Created Using My Program
I had a program created in VB6. This program produces files with an extension of *.xpc. Since this is a custom file type that my program produces, when the file is saved to the harddrive, it is an unknown filetype according to Windows so it is assigned the default Icon Windows uses when it does not know the file type. I would like this to look more professional and would like to use my custom Icon for the .xpc filetype my program creates. I do not need to know how to assign the icon to the programs .exe, I need to assign an icon to the .xpc file type and have it show up on ALL users computers. I do not know how to do this in VB6. Can anyone explain the method in detail? I am pretty new to VB.
Thanks!!
Bryan

Problem With Installation Program Created By Package Deployment Wizard
THis is the error message I get when I use the installation program created by the package deployment wizard in VB6

Does any one know what is going on and how to fix it.
=============================================
an error occured while registering the file 'C:WINNYsystem32msado25.tlb'
=============================================

Here is my setup.lst file just in case you need it

[Bootstrap]
SetupTitle=Install
SetupText=Copying Files, please stand by.
CabFile=Attendance.CAB
Spawn=Setup1.exe
Uninstal=st6unst.exe
TmpDir=msftqws.pdw
Cabs=1

[Bootstrap Files]
File1=@VB6STKIT.DLL,$(WinSysPathSysFile),,,7/15/00 12:00:00 AM,101888,6.0.84.50
File2=@COMCAT.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,5/31/98 12:00:00 AM,22288,4.71.1460.1
File3=@STDOLE2.TLB,$(WinSysPathSysFile),$(TLBRegister),,6/3/99 12:00:00 AM,17920,2.40.4275.1
File4=@ASYCFILT.DLL,$(WinSysPathSysFile),,,3/8/99 12:00:00 AM,147728,2.40.4275.1
File5=@OLEPRO32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,3/8/99 12:00:00 AM,164112,5.0.4275.1
File6=@OLEAUT32.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,4/12/00 12:00:00 AM,598288,2.40.4275.1
File7=@MSVBVM60.DLL,$(WinSysPathSysFile),$(DLLSelfRegister),,6/19/03 3:05:04 PM,1385744,6.0.96.90

[IconGroups]
Group0=Attendance
PrivateGroup0=-1
Parent0=$(Programs)

[Attendance]
Icon1="Attendance.exe"
Title1=Attendance
StartIn1=$(AppPath)

[Setup]
Title=Attendance
DefaultDir=$(ProgramFiles)Attendance
AppExe=Attendance.exe
AppToUninstall=Attendance.exe

[Setup1 Files]
File1=@MDAC_TYP.EXE,$(AppPath),,,1/20/00 12:00:00 AM,7856352,25.0.4403.12
File2=@msstdfmt.dll,$(WinSysPath),$(DLLSelfRegister),$(Shared),4/5/01 1:43:19 PM,118784,6.0.88.4
File3=@MSBIND.DLL,$(WinSysPath),$(DLLSelfRegister),$(Shared),7/15/00 12:00:00 AM,77824,6.0.88.62
File4=@MSDBRPTR.DLL,$(WinSysPath),$(DLLSelfRegister),$(Shared),7/15/00 12:00:00 AM,299008,6.0.88.4
File5=@MSDERUN.DLL,$(CommonFiles)designer,$(DLLSelfRegister),$(Shared),7/15/00 12:00:00 AM,136192,6.0.88.4
File6=@MSCAL.OCX,$(WinSysPath),$(DLLSelfRegister),$(Shared),2/9/99 11:42:26 PM,106496,9.0.0.2607
File7=@MSCOMCT2.OCX,$(WinSysPath),$(DLLSelfRegister),$(Shared),5/22/00 12:00:00 AM,647872,6.0.88.4
File8=@MSADODC.OCX,$(WinSysPath),$(DLLSelfRegister),$(Shared),5/22/00 12:00:00 AM,118976,6.0.88.4
File9=@COMDLG32.OCX,$(WinSysPath),$(DLLSelfRegister),$(Shared),5/22/00 12:00:00 AM,140488,6.0.84.18
File10=@MSFLXGRD.OCX,$(WinSysPath),$(DLLSelfRegister),$(Shared),5/22/00 12:00:00 AM,244416,6.0.84.18
File11=@PDADDIN.DLL,$(WinSysPath),$(DLLSelfRegister),$(Shared),7/15/00 12:00:00 AM,57344,6.0.0.8450
File12=@msado25.tlb,$(WinSysPath),$(DLLSelfRegister),$(Shared),7/13/01 8:39:22 AM,81920,2.70.7713.0
File13=@Attendance.exe,$(AppPath),,,9/2/03 12:18:20 PM,229376,1.0.0.0

Assigning VB Code To A Dynamically Created Button In Excel
I have a question. I have a procedure in Visual Basic (Excel) that created several additional sheets with a button on each newly created sheet. I'm using the following code to create sheets and add buttons:

=================================
sname = "product" + Str(index1)
NewSheet.Name = sname
Sheets(sname).OLEObjects.Add(ClassType:="Forms.CommandButton.1", Filename:="Sheet1", Link:=False _
, DisplayAsIcon:=False, Left:=233.25, Top:=125.25, Width:=61.5, Height _
:=16.5).Select
=================================

Now, how do I assign a procedure(procedures) to the newly created buttons? You see, I want a particual procedure to execute when a user clicks on this button, but I have no idea how to "tie" a procedure to a dynamically created button.

Thanks for your help!

Trying To Reduce Excess Code Created By Recording Macro
I'm really new a this and am learning that some code created by the recorder can be reduced. attached is my string of code I've tried to reduce and failed on step 2 and 3. the hard part is step 2 will write in the same cell as step one at the end of the first statement. step three does the same this works well but trying to learn how to reduce code. any ideas

' UPDATE SI COMMENTS SECTION
'SI COMMENTS FOR QUICKLOOK
Windows(inputfile).Activate
Worksheets("SI BRIEF DOCUMENT").Activate
Worksheets("SI BRIEF DOCUMENT").Range("C24").Select
Selection.Copy
Windows(destfile).Activate
Worksheets("SENIOR MEMBER NOTES").Activate
Worksheets("SENIOR MEMBER NOTES").Range("B12").Select
Selection.PasteSpecial Paste:=xlValues

step 2
'INSPECTION AREA COMMENTS FOR QUICKLOOK
Windows(inputfile).Activate
Worksheets("SI BRIEF DOCUMENT").Activate
Worksheets("SI BRIEF DOCUMENT").Range("C25").Select
newentry = Selection.Value
Selection.Copy
Windows(destfile).Activate
Worksheets("SENIOR MEMBER NOTES").Activate
Worksheets("SENIOR MEMBER NOTES").Range("B12").Select
oldentry = Selection.Value
If oldentry = "" Then Selection.PasteSpecial Paste:=xlValues Else Selection.Value = oldentry & Chr(10) & newentry

step 3
'OTHER COMMENTS
Windows(inputfile).Activate
Worksheets("SI BRIEF DOCUMENT").Activate
Worksheets("SI BRIEF DOCUMENT").Range("C27").Select
newentry = Selection.Value
Selection.Copy
Windows(destfile).Activate
Worksheets("SENIOR MEMBER NOTES").Activate
Worksheets("SENIOR MEMBER NOTES").Range("B12").Select
oldentry = Selection.Value
If oldentry = "" Then Selection.PasteSpecial Paste:=xlValues Else Selection.Value = oldentry & Chr(10) & newentry

Basing A Data Report On A Recordset Created In Code
Hi

I’m used to using Visual Basic 6 data reports based on data commands.  My problem is that I have a form which dynamically builds up a SQL statement depending on what criteria is selected by the user.  This statement then gets fired to display a datagrid with the results.  All that works fine but I need to be able to have those results presented in a nice report.  

Is there a way of basing a data report on a recordset created via code or is there a way of creating a data command dynamically, based on a recordset in code which can then be used as input to the report?

Thanks
Andrew


Question About Code Created By ActiveX Control Wizard
Dear Sir,

Whenever I create an ActiveX control with the help of theActiveX control wizard, VB adds the following comments before Property Get :
                                
           'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES:
           'MappingInfo=UserControl,UserControl,-1,BorderStyle

           what is it? I also find such trailing comments at the declarations of every events, like :

             Event Resize() 'MappingInfo=UserControl,UserControl,-1,Resize


Please help me.

Error In Code That The Data Form Wizard Created!
Hi,

I used the data form wizard to creat a form, controls and code for a database im practicing on.

Problem is the code that the wizard has created contains error...

Code:
Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
  'This will display the current record position for this recordset
  datPrimaryRS.Caption = "Record: " & CStr(datPrimaryRS.Recordset.AbsolutePosition)
End Sub


It highlights the first line and says

Compile error:
     Procedure declaration does not match description of event or procedure hving the same name.

Thanks for you help

- Chris

VB 5.0 Code Not Working With Manifest File Created By Prior Install
The code was recompiled with changes on the server with VB5.0. It uses a ocx ss32x25.ocx and is referenced to a MANIFEST file. The executable works on the server but is not working on my local machine where VB is not installed. Could anyone please help.

I Created A Button On Spreadsheet's Toolbar. How To Connect (link) It To Vb Code Within Excel Spread
I created a button on spreadsheet's toolbar. How to connect (link) it to vb code within excel spreadsheet, that is, when I click on the button, it can start the vb program within excel spreadsheet? - thanks

Unload All Created Picture Box's [created @ Runtime] *slved*
Hey yer guys.

OK, i have some Picture Box's, which are created when a user enters my chat room, and then unloaded when the user exit's

These picture box's index are the connection index's to my chat server the user is using.. [ So they are unique to the user ]

Anyhow, i have got them loading when the user enters / leaves the room

But if I Leave the room i need to unload all loaded picture box's except the one with and index of 0

Now, how can i loop through each picture box, in the form?

IE: for unloading forms u can do:


VB Code:
Dim frm as formfor each frm in forms             unload frmnext frm


is there a way i can do the same for the picture box's?
[BTW: My name for the picture box's are "imgAV" [if that helps ne?]

Thanks

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