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




Runtime Error In Saving Of Multiple Transactions


Hello Sir,
       I got below runtime error at connection.Begin Trans, when i am trying to save more than 30 transactions in my Banking Project.

Error:

Run Time Error -2147168237(8004d013)
Cannot Start More Transactions On this Session

How can i solve this problem. Plz give me solution for this problem.

Thanking You,

Lalitha.C




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Visual Basic Runtime Error "Error Saving Document
Dear all,
I am saving a document from vb. While saving I get this error. This error occurs only when I run the exe file. This problem doesnt occur while developing the project.
There is no problem with the path. What else may be the problem?

How to rectify this error " Error saving Document" in visual basic 6.0

Pls Help, this is very urgent.

Thanks to all.

Rgds,
Visha

Multiple Transactions
How can I start multiple transactions..

below is what i am currently doing.


public insert ()

on error goto err_handler
transtart = false


securityobj.connection.beginstrans

i am doing my insert statement over here




securityobj.connection.execute gssql
securityobj.connection.commit trans

i have again do a insert statement over here..

how to start the transaction again and do that.

Multiple Transactions
Hey all

Quick question.
In our project we have 1 connection.
We are using transactions to control data access etc.

Is it possible to open several transactions on this 1 connection??

ta
Dave

Multiple Transactions
I am trying to do multiple transactions in succession but I get an error message (-2147418113 (8000ffff)) on the rs.movenext. I have created a simple version for testing (you see beneath) but I get the same error message. Does anybody know what goes wrong?



Code:
Sub test()

Dim rst As New ADODB.Recordset
Dim cnn As New ADODB.Connection

Dim lng As Long


cnn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TIS0306P;Data Source=."

rst.Open "CSSDKContrKop", cnn, adOpenDynamic, adLockOptimistic

Do Until rst.EOF

lng = cnn.BeginTrans

rst![Valuta] = "S"

rst.Update

cnn.CommitTrans

rst.MoveNext

Loop

End Sub

Multiple TRANSACTIONS To A Single AGENT
Hiya ppl...

it's me again. im currently doing a project- somewhat a Unit Trust Management system. It's rather complicated, to me (ARGH! X_X) My question this time round is, how do i allow multiple input to a single agent?

This's how the transaction input works:

1. A unit trust agent will submit source documents containing details of 'sales'( of unit trust, of course) to the data entry clerk.
2. The data entry clerk will input the transactions into a 'transaction' file ie. tblSales ( a table in the database)
3. The input will be - Many transactions to ONE agent.

How can I accomplish that WITHOUT having to REPEAT an agent's detail (eg. AgentID, transaction date,etc) as many times as the number of transaction for that particular agent?

A friend said that i could incorporate the use of spreadsheets in vB.. if so, does anyone know how i could do that? If that's not possible, how else can i input the multiple transactions?

 

Edited by - hueyjenn on 3/5/2003 6:24:50 AM

Help!! VB / Access 97 Multiple Transactions Don't Work!!!!
I am having a problem processing multiple transactions. I am using VB6 with an Access 97 database. I am using a Workspace object to
commit or rollback transactions to the database.

I have two forms that have 2 separate transactions.I am committing a transaction and then unloading the first form. The user is forced into the second form that has another transaction. When the code in the 2nd form tries to pull data from my database, it can't find the data and gives a "type mismatch" error. I've tried closing the database and setting it to nothing after the first transaction and I've tried closing the workspace and creating a new one. Nothing works.

I know the code in the 2nd form works correctly because if the application is started and the 2nd form is chosen before going into the first form, the transaction works correctly. The second form's transaction doesn't work correctly when going from the first form into the second. Any ideas?

I also tried:

1. Tried giving a rollback when the 2nd form opens. Got error "trying to rollback without begintrans", so...
2. Tried giving a begintrans and committrans when the 2nd form opens. Did not work. It still could not see the database after the 1st form's committrans.
3. Tried using another database variable and another variable for the recordset. It still could not see the database.

I guess my only other solution is to cause the application to stop execution after I commitTrans and then make the user re-open the application.

Other ideas?

VB Runtime Error "Error Saving Document"
Dear all,

When I try to save a word file from vb, I am getting the error "Error saving document".
There is no problem with the path. What else may be the problem.

Pls Help....this is very urgent.

Thks n rgds,
Vishalakshi

ADODB.connection Nested Transactions Error
Hello,

I'm trying this code for nested transactions

Dim cnn1 As ADODB.Connection

Set cnn1 = New ADODB.Connection
cnn1.ConnectionString = "DSN=DSNDATABASE;UID=sa;PWD=;"
cnn1.Open 'works OK

tranLevel = cnn1.beginTrans 'works OK
....
tranLevel = cnn1.beginTrans 'here I get this error: "cannot start more transactions on this session"

DSNDATABASE refers to an MSSQLServer Database in the ODBC, which I believe does support nested transactions

any ideas on this one? I've checked the internet but can't find the correct answer to this

thanks in advance,
Mariano

Current Provider Does Not Support Transactions Error 3251
Hi all, I have made an application that connects to an MS Access 2000 database which sits on an IIS server on a Windows XP machine. I am using a MS Remote provider and configured the server for read/write permissions. Everythings seems to go alright.. but when I try adding data into the database, it crashes on a .CommitTrans and gives me the error message Error 3251: Current Provider does not support Transactions. Are there any solutions to this problem ? I tested putting data into the database with a .execute command and it works with no problems. That proves my write permissions are working and the data can being written. What other settings do I need to check for ? Cheers





A VB turned PHP geek

Saving Changes To A Form At Runtime
I want to create an application (it is actually a vba addin application) where I have a form with 2 option buttons (option button 1 is set to true by default) and at run time lets say the user selects option button 2. How can i capture this change so that next time the form is opened it will still reflect the change ie. show that option button 2 is selected.

Saving Information During Runtime
how to save calculated information during run time at database without using textbox

Saving New Items To A Combo Box In Runtime
Hi, Could anyone help please?

My program has a 5 combo boxes. "cboPC", "cboLap", "cboGen", "cboCable" and "cboAdd" and a text box "txtItem". In "cboAdd" there are the choices of the other 4 combo boxes in it. What i would like is when the Add button is clicked, it adds "txtItem" to the combo box chosen from "cboAdd" and saves it so that when the form is reloaded it is still there.

I have been told i need to write it to a file, but dont know how to do this? Help appreciated!

Here is the code i have so far for adding it to the combo boxes:


Code:
Private Function AddItem()

If cboCat.Text = "PC" Then
cboPC.AddItem txtAddItem.Text

ElseIf cboCat.Text = "Laptop" Then
cboLap.AddItem txtAddItem.Text

ElseIf cboCat.Text = "Cable" Then
cboCab.AddItem txtAddItem.Text

ElseIf cboCat.Text = "Backup" Then
cboBack.AddItem txtAddItem.Text

ElseIf cboCat.Text = "ID" Then
cboCard.AddItem txtAddItem.Text

ElseIf cboCat.Text = "General" Then
cboGen.AddItem txtAddItem.Text

End If

End Function

Saving Form's Color At Runtime
Hello all,

I have a form that you can change the form's backcolor and the menu's color at runtime, but when you exit out of the program, the colors go back to their original state. Is there someway I can, once I change the color, make the form stay that color when exited and opened back up?

Runtime Error 52, Bad File Name Or Number && Path/File Error Runtime 75 HELP!!!
Alright, I had recieved some help on a different board, but my problem wasn't resolved... The code is for a button for the user to choose the files to add to the listview, for upload later in the ftp program. The problem is that it seems to give a runtime error 52 once you try to add more than 3,4, or 5 files, and the "solution" which was given to me by another poster, doesn't work. It results in eliminating the runtime error 52 and bringing out a err 75... Below is the original code that generates the runtime error 52 when 4 or more or so files are added.. :

Dim strfilename As String
Dim vFiles As Variant
Dim lFile As Long
Dim Y As Long
With wizard_main.CD1
.Filename = "" 'Clear the filename
.CancelError = False 'Gives an error if cancel is pressed
.DialogTitle = "Select File(s)... (Multi Select)"
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHideReadOnly 'Falgs, allows Multi select, Explorer style and hide the Read only tag
.Filter = "All files (*.*)/*.*"
.MaxFileSize = 9999
.ShowOpen
vFiles = Split(.Filename, Chr(0)) 'Splits the filename up in segments
If UBound(vFiles) = 0 Then ' If there is only 1 file then do this
Open .Filename For Binary Access Read As #1
Size = LOF(1)
Close #1
DoEvents
DoEvents
Set Item2 = frmmain.ListView3.ListItems.Add(, , .FileTitle)
Item2.SubItems(1) = .Filename
DoEvents
Item2.SubItems(2) = frmmain.mFTP.GetFTPDirectory
DoEvents
Item2.SubItems(3) = frmmain.TxtConnectedTo.Text
DoEvents
Item2.SubItems(4) = Size
Y = Item2.SubItems(4)
DoEvents
DoEvents
frmmain.TxtTotalBytesQueued.Text = frmmain.TxtTotalBytesQueued.Text + Y
frmmain.Text1.Text = frmmain.Text1.Text + Y
DoEvents
DoEvents
DoEvents
Item2.SubItems(5) = "Upload"
DoEvents
Else
For lFile = 1 To UBound(vFiles) ' More than 1 file then do this until there are no more files
Open vFiles(0) + "" & vFiles(lFile) For Binary Access Read As #1
Size = LOF(1)
Close #1
DoEvents
DoEvents
Set Item2 = frmmain.ListView3.ListItems.Add(, , vFiles(lFile))
DoEvents
Item2.SubItems(1) = vFiles(0) + "" & vFiles(lFile)
DoEvents
Item2.SubItems(2) = frmmain.mFTP.GetFTPDirectory
DoEvents
Item2.SubItems(3) = frmmain.TxtConnectedTo.Text
DoEvents
Item2.SubItems(4) = Size
Y = Item2.SubItems(4)
DoEvents
DoEvents
frmmain.TxtTotalBytesQueued.Text = frmmain.TxtTotalBytesQueued.Text + Y
frmmain.Text1.Text = frmmain.Text1.Text + Y
DoEvents
DoEvents
DoEvents
Item2.SubItems(5) = "Upload"
DoEvents
Next
End If
End With


* Open vFiles(0) + "" & vFiles(lFile) For Binary Access Read As #1 is the problematic line


*************************************************************************************8

Below is the code which was suggested, and fixes the first problem, but upcomes a new problem..


Dim vFiles As Variant
    Dim lFile As Long
    Dim intfile As Integer
    Dim Y As Long
    With CD1
        .Filename = "" 'Clear the filename
        .CancelError = False 'Gives an error if cancel is pressed
        .DialogTitle = "Select File(s)... (Multi Select)"
        .Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or cdlOFNHideReadOnly 'Falgs, allows Multi select, Explorer style and hide the Read only tag
        .Filter = "All files (*.*)/*.*"
        .MaxFileSize = 9999
        .ShowOpen
        vFiles = Split(.Filename, Chr(0)) 'Splits the filename up in segments
    If UBound(vFiles) = 0 Then ' If there is only 1 file then do this
    intFile = FreeFile()
    Open .Filename For Binary Access Read As #intFile
    Size = LOF(intFile)
    Close #intFile
    DoEvents
    DoEvents
    Set Item2 = ListView3.ListItems.Add(, , .FileTitle)
    Item2.SubItems(1) = .Filename
    DoEvents
    Item2.SubItems(2) = mFTP.GetFTPDirectory
    DoEvents
    Item2.SubItems(3) = frmmain.TxtConnectedTo.Text
    DoEvents
    Item2.SubItems(4) = Size
    Y = Item2.SubItems(4)
    DoEvents
    DoEvents
    TxtTotalBytesQueued.Text = TxtTotalBytesQueued.Text + Y
    Text1.Text = Text1.Text + Y
    DoEvents
    DoEvents
    DoEvents
    Item2.SubItems(5) = "Upload"
    DoEvents
    Else

    'i changed the next line from For lFile = 1 To UBound(vFiles)
    For lFile = 0 To UBound(vFiles) 'More than 1 file then do this until there are no more files

    intfile = FreeFile()
    'hmmm you really need to look at the next line. not sure why the backslash is in there
    'Open vFiles(0) + "" & vFiles(lFile) For Binary Access Read As #intfile
    'try this instead:
    Open vFiles(lFile) For Binary Access Read As #intfile
    Size = LOF(intfile)
    Close #intfile

    DoEvents
    DoEvents
    Set Item2 = ListView3.ListItems.Add(, , vFiles(lFile))
    DoEvents
    Item2.SubItems(1) = vFiles(0) + "" & vFiles(lFile)
    DoEvents
    Item2.SubItems(2) = mFTP.GetFTPDirectory
    DoEvents
    Item2.SubItems(3) = frmmain.TxtConnectedTo.Text
    DoEvents
    Item2.SubItems(4) = Size
    Y = Item2.SubItems(4)
    DoEvents
    DoEvents
    TxtTotalBytesQueued.Text = TxtTotalBytesQueued.Text + Y
    Text1.Text = Text1.Text + Y
    DoEvents
    DoEvents
    DoEvents
    Item2.SubItems(5) = "Upload"
    DoEvents
    Next
    End If
    End With


***********************************************************************************

I would really appreciate it if someone could help me fix this bug ...



Edited by - AbsintheDrinker on 4/13/2004 11:43:04 PM

Adding (and Saving) Items To A List At Runtime
I am creating a program that will run in the systray and when the user clicks the icon a menu of files will appear.
When the user selects a file the file will open in it's respective app (like Word or Excel).

I want to be able to give the user the option to add files to the list so they will be available next time he starts the app.
I'm betting that this will require some type of data file for the app to read and write to, but I don't have any experience with this...Any suggestions?

Also, I would like to allow the user to customize the layout of the menu so that he can arrange frequently used files at the bottom and even add spaces between groups of file items ...Any suggestions here?

Thanks guys and girls!!!

Saving Multiple Listboxes
How Can You Save Multiple Listboxes In One File??

Saving Multiple Files
hi,

Presently i using the below coding to save the file. I tried to save the second file in differernt name bu using a int count. It seems cant work.

Can You help me on this matters.

thank you very much.
-----------------------------------------------------------------
Dim FF As Integer
FF = Free file
intCount = intCount + 1

Open "A:Memo" & intCount & ".txt" For output As #FF
Print #1, text 1.text

Close #FF
----------------------------------------------------------------

Saving Multiple Things
Ok guys I need some help from you kind people. I would like someone to give me an example of saving two labels (label1 & label2) to a single file that when re-opened will go back to the original labels. I dont really mind what format the save file is in.


Thanks

-Lucas

Saving Multiple Textboxes
Hi all, was wondering if ne1 can help me, I got a forma that has multiple textboxes, its used for storing staff records.
I got a save button and i want it to, once pressed would save all the data into a single txt file. how do i do that? i started it but i got stuck

Thanks for helping

Private Sub Command2_Click()

msgReply = MsgBox("Staff details saved, exit to main menu?", vbQuestion Or vbYesNo)
If msgReply = vbYes Then

Else

msgReply2 = MsgBox("Add another record?", vbQuestion Or vbYesNo)
If msgReply2 = vbYes Then
'Clear textboxes to add another record
Name.Text = ""
AddressL1.Text = ""
AddressL2.Text = ""
AddressL3.Text = ""
Name.SetFocus

End If
End If
End Sub

Saving Multiple Images As 1
Im only 12 but im a beginner programmer, i need help on saving about 20 image boxes which overlap but saving them as one. The program is just a simple 'for next loop' and when you put in text in a text box, for each letter it puts a certain image into seperate image boxes, at the moment the people who have it have to press the 'print screen' button and then crop it in a graphics editor. So I need help on saving seperate, overlapping images as 1 bmp or gif.

Saving Multiple Values
Hey guys, I was wondering if anyone can suggest the best way to save a large number of variables and call them back again. (And by suggest I mean a tutorial or link to a tutorial as well :P)

Thanks in advance.

Saving Multiple Strings In Textfile
VB6:

Hello All. I have two forms: Form1 has multiple textboxes that each requires only a short, single line of text input. Form2 has two textboxes that each holds a long, multiple lines of text input. I use one file to save all text on form1. All the text are saved and loaded properly into the textboxes. For form2 I use the same method of one file to save the text from the two textboxes. When I load the text into the two textboxes, sometimes the text in textbox1 appears in textbox2, especially in the initial saving when the two textboxes are blank. My solution: I use two files: one for each textbox. This works fine, but I don't lke it because I end up in too many files. Is there a better solution? And why the same method does not work in form2?

See my code in both forms:

Code:
' Form1 with 3 textboxes
' Read file and Load text to textboxes
NewChildFileNumber = FreeFile
Dim FindFilename As String
FindFilename = Dir$(NewChildNoteFile)
If FindFilename = "" Then
' Createfile if file not existed
Open NewChildNoteFile For Output As NewChildFileNumber
Print #NewChildFileNumber, Me.TxtStartDate.Text
Print #NewChildFileNumber, Me.TxtSiteAddress.Text
Print #NewChildFileNumber, Me.TxtClassDays.Text
Close NewChildFileNumber
Else ' If filename was found, read record
Open NewChildNoteFile For Input As NewChildFileNumber
Do While Not EOF(NewChildFileNumber)
Line Input #NewChildFileNumber, BufferStartdate
Line Input #NewChildFileNumber, BufferAddress
Line Input #NewChildFileNumber, BufferClassDays
'CRLF not required since it's a short single line of text
TxtStartDate.Text = TxtStartDate.Text + BufferStartdate
TxtSiteAddress.Text = TxtSiteAddress.Text + BufferAddress
TxtClassDays.Text = TxtClassDays.Text + BufferClassDays
Loop
End If
Close NewChildFileNumber
'====
'Form1. Save text file
NewChildFileNumber = FreeFile
Open NewChildNoteFile For Output As NewChildFileNumber
Print #NewChildFileNumber, Me.TxtStartDate.Text
Print #NewChildFileNumber, Me.TxtSiteAddress.Text
Print #NewChildFileNumber, Me.TxtClassDays.Text
Close NewChildFileNumber
'====
'====
' Form2 with 2 textboxes. Each textbox hold multiple lines of text
' Read file and Load text to textboxes
' Save method as Form1
CRLF = Chr$(13) + Chr$(10)
NewChildFileNumber2 = FreeFile
Dim FindFilename2 As String
FindFilename2 = Dir$(NewChildNoteFile2)
If FindFilename2 = "" Then
' Createfile if file not existed
Open NewChildNoteFile2 For Output As NewChildFileNumber2
Print #NewChildFileNumber2, Me.TxtReferralDate.Text
Print #NewChildFileNumber2, Me.TxtFollowupDate.Text
Close NewChildFileNumber2
Else ' If filename was found, read record
Open NewChildNoteFile2 For Input As NewChildFileNumber2
Do While Not EOF(NewChildFileNumber2)
Line Input #NewChildFileNumber2, BufferReferraldate
Line Input #NewChildFileNumber2, BufferFollwupDate
TxtReferralDate.Text = TxtreferralDate.Text + Bufferreeferraldate +crlf
TxtFollowupdate.Text = TxtFollowupdate.Text + BufferFollowupdate + crlf
Loop
End If
Close NewChildFileNumber2
'====
'Form2. Save text file
NewChildFileNumber2 = FreeFile
Open NewChildNoteFile2 For Output As NewChildFileNumber2
Print #NewChildFileNumber2, Me.TxtReferralDate.Text
Print #NewChildFileNumber2, Me.TxtFollowupDate.Text
Close NewChildFileNumber2

'Because the above code for Form2 does not work properly,
'I use one file for each textbox. The code is not shown here.
Does anyone have a better solution? I will appreciate anyone's help or suggestions.

Thank you
Mydanvue

Multiple Image Saving And Resizing...
I hope that this is the correct forum - but I am new, so please forgive me!....Anyway....

Hi there, I am looking for what code to use in VB-6 so than when I click a command button labeled -CONVERT-, the program i have converts all the selected images in the file box to a BMP at the secified resolution setting (either - 32x32, 64x64, 128x128, 256x256 or 512x512) First of all is this possible? , and does anyone have some code which could help me? For now i just want the program to save all the selected images to the resolution specified. CAN ANY ONE HELP ME HERE!?

This is the interface I have designed - for which I need the code example...I think you get the idea from the picture..well..i hope so! .......

Opening And Saving Multiple Files
I'm attempting to write a program that will automatically open files in a given directory, perform some operations (this part I have) and then save the modified file using the same directory structure and name but on a different server. The problem is that there is no pattern to the files to be opened. Except that the folders have dates on them. Inside the folder there is a random number of files that are named randomly. This program is supposed to run in the background at all times. I'd appreciate any help you can provide.

Script For Saving Multiple Files
Hi,
I am not very familiar with VB but I need to write a small program in it.
I have a list of symbols (several 1000) in a worksheet. For each symbol, I want to invoke some functions and save the results to a file. I want to make sure the results are saved and that file is closed. I want to do the same for all the symbols.
For each symbol "sym",
call fn1, save results in sym_out1
call fn2, save results in sym_out2
..

do this for all the symbols.

Could you please give me a sample program or point me to one that would help me through this?

You help is greatly appreciated.

cheers,
Sam

Saving A File To Multiple Folders
I want to create a simple vb5 exe that lets me choose a file and copy it (replace existing file) to 52 different folders. The file needs to be located in a month/week folder thus 52 folders (see attachment)

Hope this can be done.

Saving Multiple Lines To A Text
Quick question:

I am makeing a text file to log when the times my program has been started and shut down. Here is my current code

'On start up
a = "Started on " & Date & " at " & Time

Open App.Path & "log.txt" For Output As 1
Print #1, a


'On shut down
s = "Stoped on " & Date & " at " & Time

Open App.Path & "log.txt" For Output As 2
Print 2, s

Works fine but when you shut the progam down the shut down info overwrites the start up info. So my question is how do i make the shut down start another line on the log.txt.

Also when the program starts again i dont want it to overwrite the previous info. i would like the log.txt file to retain all the info in a running list.

Any help would be great. Let me know if on the right path
thanks

Saving Multiple Lines Of Text....
I hope I can explain this correctly. I am trying to get my program to open multiple lines of text in my text box. I save the information then when It is loaded it only shows one line of text instead of all of the text I am trying to save. I am working with ini files. I have my multiline set to true. I hope that someone understands what I am asking I do not know how to explain myself to well. Thank you for your help

Saving Multiple Rows In A SQL Database
I am currently faced with a complicated situation and I am not certain I can explain it clearly so I apologize in advance if this doesn't make a lot of sense.

I am receiving a comma delimited text file from an outside vendor. The layout looks like this
MSH,12345,08/29/2003,82312345,ERT,2,3,PID,Schmo,Joe,M,W,N,04/22/1957,ABC123456789,JS12345,EL,Illif,12345,123,B,Anywhere Lane,West,1234 B Anywhere Lane,Nowhere,KS,11111,SAM,08/21/2003,,N,04,Family Practioner,08/27/2003,09/02/2003,SPM,17,Other,HIV,22,ABC,N,01,01,SPM,02,,RUB,02,04/02/2003,TLC,Test coment Rubella,PID,Doe,Jane,F,W,N,03/25/1967,DEF987654321,12345ABC,SN,DRNO,2345,987,SW,Smith Drive,NULL,987 SW Smith Drive,Nowhere,KS,11111,SAM,08/21/2003,,N,11,Other,,,SPM,01,,HIV,A1,DEF,N,01,01,RLC,Did this test work

I have managed to separate each field into a variable and now need to save those variables onto a SQL table.

The problem is I have multiple PID’s and multiple SPM’s. I need to insert a new line for each. For example since I have 2 SPM’s for PID Joe Schmo I will need
Two lines in the SQL table. The first line must contain the MSH information, the PID information, the SAM information and the first SPM information, and the HIV information.

The second line must contain the MSH information the PID information, the SAM information and the second SPM information, the RUB information, the TLC information.

I have attempted to insert this information all at once but only get the information for the PID, SAM,SPM,HIV, and RLC information for Jane Doe.

When I use a loop I get an error message telling me MSH cannot be NULL and the transaction is aborted.

Saving Multiple MSCharts In 1 Bmp File.
Hello all,

I hope I'm using the correct forum here.

I have looked through quite a few posting here but have yet to come across one that deals with arrays of MScharts being output to a single *.bmp file.

I am using VB 6.0 and have created a program that uses an array of MScharts (i.e. MSchart1(0), MSchart1(1), etc...). What I have at present is 4 MScharts, (arrays 0 - 3), inside a Picture1 control. I've tried "Savepicture Picture1, filename" but only get a bitmap of the Picture1 control background.

As I am a novice programmer, I am not real sure how to use the API function calls that I am sure are required to get the output that I'm looking for (i.e. 1 bitmap file with all 4 MScharts captured in the file.

If anyone has any ideas on the correct code to use so I could achieve the end results I need, I would really appreciate helping hand here.

Thanks in advance.

robcoe

Saving Multiple Listboxes In A File
I have 8 Listboxes and i want to be able to save them in 1 file is it possible?? and if so can i get guidence on how to do it?

Saving Of Multiple Selected Xls Into Csv File
Is it possible to save multiple selected excel file into .csv file in VBA using filelistbox selection?

Thanks...

Saving Multiple E-mails [SOLVED, Thank You]
How do you save multiple E-mails?

Multiple Txtboxes Saving To File
How can I do this.
I have 4 text boxes side by side, and I want to save all of their
contents to a file. But I want the file's contents to reflect how
they look in the text boxes side by side. What I mean is I can't
save the first text box and then the second, third, etc., but I need
to get line #1 from textbox1, textbox2, textbox3, & textbox4 and
that will be the first line of the text file......

How can I do this in a loop??

Thanks for any help.

Saving Multiple Textboxes To 1 File
how do i save multiple textboxes to one file for example a textfile

Saving Multiple Files With Same Name, Different Number
I have written a small special purpose text editor that I use to prepare draft copies of text documents in the law office where I work after school. It works great, but I need to add a feature to it, if possible.

A legal document may have a newly edited draft each day for several days. I am required to save these progressive drafts by the same name with a progressing number. i.e. Excell01, Excell02, Excell03, etc.

My question: Can someone please give me a sample code that I can include in my text editor that will allow me, when saving a file, to type only the file name (without the number) and have the program look up and add the next available number to the end of the name. It's often difficult and time consuming to find the next available number.

Please help if you can!

Thanks!

Wendy

Saving Multiple Files From A List
I have an app that populates a list with all the files in a folder that is selected by the user. The user can then enter a date and all files modified before the date will be removed from the list.

The bit i'm struggling with is allowing the user to save all the files left in the list or saving multiple selected files from the list using 'Save as' so they can save the files in a new folder.

Any help is appreciated.

Saving Multiple Accounts On Forms
Hi

Can anyone give me some help, the problem is I have a database containing 800 records we use a combo box to look up eash record, but I have now been told that I have to keep a record of the amount of money paid on each account ( we dont need to add it up ) these accounts are paid monthly so I need to have 12 fields 1 for money paid out, & 1 for the date of payment. I have tried using form fields linked to a list box but cannot get the data to go into it .

The amount on each account (form) would be different to the others i.e. on account A1234 we might pay £12.00 then £13.00 on the next bill and so on. But on account E4567 we might pay £36.00 then £38.00 and so on.

Any suggestions would be welcome


Thanks

Saving File In Multiple Disks
my question is, i want to load a file into multiple floppy disks (as well retrive from disks)as the file size is more than 1.44MB, i want to make a DLL in VB (as i want to write code in VC++) and make a DLL and use it in VB, how to do this, please let me knwo the code for doing this
thanx
shekar

Multiple Instances Of ActiveX At Runtime???
I'd like to know if I can create/add multiple instances of an ocx at runtime?

The ocx is third party - I have a license for it, but not the source code.

I'd like to be able to do something like this (Pseudo-code):

Code:
Dim ocxArray() as TheActiveX

Redim ocxArray(2)

ocxArray(0).Load "C:myfile"
ocxArray(1).Load "C:yourfile"
ocxArray(2).Load "C:ourfile"

...etc....

I've tried "CreateObject":
Dim junk as Object
Set junk=CreateObject("TheActiveX")
but I get "Runtime error 429 ActiveX can't create object"

I've tried "Controls.Add"
Dim junk as Control
Set junk=Control.Add("TheActiveX", "myname")
but I get "Runtime error 711 Invalid class string Looking for object with ProgID TheActiveX"

Can anyone help???

Multiple Picture Boxes At Runtime
i am making a picture viewer program. i would like to know how to get all of the pictures in a folder and put them into pictureboxes that are thumbnails of the original picture. when you double click on the thumbnail, it will come up in a picturebox in a seperate form. (full size). i would also like to know how to put a sidebar with thumbnails of the open pictures. any help would be greatly appreciated.

just to recap:
1)open form with drive list box and file list box to select folder, pictureboxes of thumbnails of all of the pictures in the selected folder.
2)picture selected is opened in a seperate form
3)sidebar with thumbnails of all the open pictures.

Creating Multiple Arrays At Runtime
Ive looked at this for a few days now, cant get anywhere, lets hope someone knows...

I want to load into memory a MIDI sequence. I have a UDT, which is similar to

Type midiEvent
.message as byte
.data1 as byte
.data2 as byte
.time as long
end type

I can load in an entire sequence to memory by creating an array of this type, eg. SEQ() as midiEvent. However, my program needs to load in as many sequences as the user specifies. Originally I wanted to create arrays at runtime, determined by the MIDI files name (such as SEQ001(), SEQ002(), but as you cannot dynamically create arrays without predetermining the names (correct??), that failed.
I could create a 2D array, but if i have 10 small files in memory, and 1 massive one, there is masses of wasted memory space caused the 1 large file expanding the bounds of the array to fit in. Also, doing it this way, I have to predetermine the maximum number of sequences which can be added due to only being able to change 1 boundary of a 2D array when using the Preserve command.

Any ideas how to achieve this? Can i create an array of arrays based on an array of my UDT? Or is this bad for memory too?
Any help appreciated!!

Multiple Instances Of ActiveX At Runtime?
I'd swear I've seen this done, but can't remember how.

I'd like to create an array of an activex component at runtime so that I can access multiple instances of it.

Something like this pseudo-code:


Code:
Dim AXarray() as myActiveX

Private Sub Form_Load()
ReDim AXarray(2)

AXarray(0).load "myfile"

AXarray(1).load "yourfile"

AXarray(2).load "ourfile"
End Sub


Can someone please help?

Thanks.

Load Multiple Objects At Runtime
i know this question has been answerd alot of times, but i cant find any of those when searching, so...how do i load for example alot of commandboxes at runtime?

Create Multiple Controls At Runtime
Hello,

How can I put multiple controls to a form at runtime?
For instance:

At runtime I want to put 2 textboxes, 1 combobox and 1 checkbox


Thanks

Multiple Winsock Controls At Runtime
I don't know if I can explain what I am after very well so here goes:

how do you make multiple winsock controls at run time? as in I think it is called control arrays or something for example you'd have winsock1(0) winsock1(1) winsock1(2) and so on until say about 50 or so that you can have more than one connection sort of thing?

and can someone give me a code to show how to connect and send data with multiple winsocks?

thanx

HELP! --- Create Multiple ListViews At Runtime
Hey All! Long time reader, first time poster...
Version: vb6.0 sp5
Goal:
I'm using a Treeview/Listview combination to display data in a recordset object (yeah, I know, big whoop)

Problem:
Each Treeview Node Selection (200+) is potentially another recordset that will be returned and the returned data displayed in the Listview. The listview selection will then determine what User Form will be launched to edit the INDIVIDUAL record.
What I'm trying to accomplish is have a Single Design Time Listview on my Main Form and have a Class that:
1. Processes the the TreeView selection
2. Determines the type of query to run based on selection
3. Returns the data to a recordset object
4. Creates a new ListView Control
5. Populates the New Listview Control
6. Saves the new Listview to a Class Variable Collection
7. Sets the Form ListView to the new ListView

What this would allow me to do, is to cache a predetermined amount of Listviews for rapid viewing...
Example: If the Listview already exists in the Class Collection then I will set the Form ListView to the Class Collection Listview, and voila no waiting for the customer, if it does not exist, then query, populate, set the display and the next time they won't have to wait.

I would also remove/replace Listviews in my Collection once the Collection count = predetermined Cache Limit, to avoid memory issues.

I have not been successful at this... I can Dim a ListView Control in my Class but I cannot set to new...
I've done some research and found an example using the VBControlExtender object which allows me to dynamically add a control to an Objects controls collection, but still I have been unable to create more than one dynamic ListView Object.

Narrow It down and all I want is this functionality:

Option Explicit
' Set Collection on Initialize, Destroy and Destroy Collection Objects at Terminate
Private lvCollection as Collection

Public Function testme (LV_ToSet as ListView)
  Dim LV as ListView
  SET LV = NEW ListView
  ' Populate ListView
  lvCollection.Add LV
  SET LV_ToSet = LV
End Function

Any suggestions for work around, better way to cache without having to Loop through the recordset each time... would be GREATLY appreciated!


Thanks,

Basil




Edited by - basil on 4/19/2002 1:00:19 PM

Saving A UDT With Multiple Arrays To A Random File
Hi,

I am in the early stages of writing a project and have hit upon a snag which I have been trying to figure out for a few days now. I have read FAQ's, posts, tutorials, etc. but can't for the life of me see what's wrong.

I have no problem with the text box entries on my form or with the drop down list boxes. I can enter data into these and it quite happily restores when I open a data file.

The difficulties come when I enter data into a FlexGrid and try to save it. The data is fine going between the FlexGrid and ProjectFile.arrResourceHours(x,x) but won't save into a random access file. Any ideas?


Declaration of UDT in module


Code:
‘UDT declaration in Module
‘Most of the Byte variables are used to store the ListIndex from Combo Boxes
‘Exceptions are the last two arrays which store low value numbers (i.e. 0 to 255)

Type ProjFile
strURNAs String * 10
strJobNumberAs String * 7
strDescriptionAs String * 30
strDescription2As String * 30
strDescription3As String * 30
strDescription4As String * 30
strLevelDetailAs String * 30
strJobTypeAs String * 30
bytJointVentureAs Byte
strParentJobAs String * 7
bytCompanyAs Byte
strAddressBookAs String * 7
strCustomerNameAs String * 50
bytFeeTypeAs Byte
strBusinessUnitAs String * 6
bytCatCode11As Byte
bytCatCode18As Byte
strEnquiryStartAs String * 10
strEnquiryEndAs String * 10
strPlannedStartAs String * 10
strPlannedEndAs String * 10
strActualStartAs String * 10
strActualEndAs String * 10
bytCatCode13As Byte
bytCatCode14As Byte
bytCatCode15As Byte
bytCatCode16As Byte
bytCatCode18aAs Byte
bytCatCode19As Byte
bytCatCode20As Byte
bytCatCode21As Byte
bytCatCode28As Byte
bytCatCode29As Byte
bytCatCode30As Byte
strProjectDirectorAs String * 50
strPDEmailAs String * 100
strBidManagerAs String * 50
strBMEmailAs String * 100
strProjectAccAs String * 50
strPAEmailAs String * 100
strClientNameAs String * 50
strClientEmailAs String * 100
strProjectManagerAs String * 50
strPMEmailAs String * 100
strCompletedByAs String * 50
strCBDateAs String * 10
strAuthorisedByAs String * 50
strABDateAs String * 10
arrResourcePerson(30)As String * 50
arrResourceHours(20, 30)As Byte
arrUsedHours(20, 30)As Byte
End Type


Code for the form


Code:
‘Code for Form

Dim ProjectFile As ProjFile‘Used to store data from current file


‘Adds week numbers to the X-Axis of a flex grid on initialisation

Private Sub Form_Load()
Dim intIndex As Integer
MSFlexGrid1.Row = 0
For intIndex = 1 To 20
MSFlexGrid1.Col = intIndex
MSFlexGrid1.Text = "Week " & Str(intIndex)
Next intIndex
End Sub


‘Uses common dialog box to create a new file
‘Saves data structure to new file

Private Sub mnuFileNew_Click()
Dim NewProjFile As ProjFile
On Error GoTo Cancel
dlgFileNew.DialogTitle = "New Project"
dlgFileNew.DefaultExt = "pmu"
dlgFileNew.Filter = "PMU Files (*.pmu)|*.pmu|All Files (*.*)|*.*"
dlgFileNew.ShowOpen
Open dlgFileNew.FileTitle For Random As #1 Len = Len(NewProjFile)
Put #1, 1, NewProjFile
Close #1
Cancel:
End Sub


‘Uses common dialog box to open an existing file
‘Copies data to ProjectFile and to text boxes in form
‘I have omitted some similar code to save space

Private Sub mnuFileOpen_Click()
Dim OpenProjFile As ProjFile
Dim intIndexX As Integer
Dim intIndexY As Integer
MSFlexGrid1.Clear
On Error GoTo Cancel
dlgFileOpen.DialogTitle = "Open Project"
dlgFileOpen.DefaultExt = "pmu"
dlgFileOpen.Filter = "PMU Files (*.pmu)|*.pmu|All Files (*.*)|*.*"
dlgFileOpen.ShowOpen
Open dlgFileOpen.FileTitle For Random As #1 Len = Len(OpenProjFile)
Get #1, 1, OpenProjFile
Close #1
ProjectFile.strURN = OpenProjFile.strURN
txtURN.Text = ProjectFile.strURN
ProjectFile.strJobNumber = OpenProjFile.strJobNumber
txtJobNumber.Text = ProjectFile.strJobNumber
ProjectFile.strDescription = OpenProjFile.strDescription
txtDescription.Text = ProjectFile.strDescription
ProjectFile.strDescription2 = OpenProjFile.strDescription2
txtDescription2.Text = ProjectFile.strDescription2
ProjectFile.strDescription3 = OpenProjFile.strDescription3
txtDescription3.Text = ProjectFile.strDescription3

‘etc…

ProjectFile.strAuthorisedBy = OpenProjFile.strAuthorisedBy
txtAuthorisedBy.Text = ProjectFile.strAuthorisedBy
ProjectFile.strABDate = OpenProjFile.strABDate
txtABDate.Text = ProjectFile.strABDate
For intIndexY = 0 To 29
ProjectFile.arrResourcePerson(intIndexY) = _
OpenProjFile.arrResourcePerson(intIndexY)
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = intIndexY + 1
MSFlexGrid1.Text = Str(ProjectFile.arrResourcePerson(intIndexY))
Next intIndexY
For intIndexX = 0 To 19
MSFlexGrid1.Col = intIndexX + 1
For intIndexY = 0 To 29
ProjectFile.arrResourceHours(intIndexX, intIndexY) = _
OpenProjFile.arrResourceHours(intIndexX, intIndexY)
MSFlexGrid1.Row = intIndexY + 1
MSFlexGrid1.Text = ProjectFile.arrResourceHours(intIndexX, _
intIndexY)
Next intIndexY
Next intIndexX
Cancel:
End Sub


‘Uses common dialog box to save file

Private Sub mnuFileSave_Click()
On Error GoTo Cancel
dlgFileSave.DialogTitle = "Save Project"
dlgFileSave.DefaultExt = "pmu"
dlgFileSave.Filter = "PMU Files (*.pmu)|*.pmu|All Files (*.*)|*.*"
dlgFileSave.ShowSave
Open dlgFileSave.FileTitle For Random As #1 Len = Len(ProjectFile)
Put #1, 1, ProjectFile
Close #1
Cancel:
End Sub


‘As there is no way in VB to enter data into a flex grid by simply typing in a cell
‘this procedure moves a text box so that is covers the selected cell
‘Any data existing in the cell is first put into the text box

Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
txtFlexGrid1.Text = txtFlexGrid1.Text & Chr(KeyAscii)
txtFlexGrid1.SelStart = 1
txtFlexGrid1.Move MSFlexGrid1.CellLeft + MSFlexGrid1.Left, _
MSFlexGrid1.CellTop + MSFlexGrid1.Top, MSFlexGrid1.CellWidth, _
MSFlexGrid1.CellHeight
txtFlexGrid1.Visible = True
txtFlexGrid1.SetFocus
End Sub


‘When the user leaves a cell the text is written to the flex grid
‘and also to ProjectFile and then the text box hidden

Private Sub MSFlexGrid1_LeaveCell()
If txtFlexGrid1.Visible = False Then
Exit Sub
End If
MSFlexGrid1.Text = txtFlexGrid1.Text
ProjectFile.arrResourceHours(MSFlexGrid1.Col, MSFlexGrid1.Row) = Val _
(txtFlexGrid1.Text)
txtFlexGrid1.Visible = False
txtFlexGrid1.Text = ""
End Sub


‘Example of how other data is entered

Private Sub txtABDate_LostFocus()
Dim strFABDate As String * 10
strFABDate = Format$(txtABDate.Text, "dd/mm/yyyy")
txtABDate.Text = strFABDate
ProjectFile.strABDate = strFABDate
End Sub


‘Example of how other data is entered

Private Sub txtBusinessUnit_Change()
ProjectFile.strBusinessUnit = txtBusinessUnit.Text
End Sub
Any help would be greatly appreciated.

Trouble Saving Multiple Excel Documents- Please Help
Hello

I have this program that I collect data for service call and when I'm done. I save files as .xls but separate the reports from the invoice. On this specific page. I click "Save" to save the report and another button to save invoice. They will not work one after another, either or but not after each other. I know it's has to be a simple mistake but I'm stumped. Here's the code.

Code:
Private Sub InvoiceSave_Click()

Do
Sheets(Array("Invoice")).Copy

fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd") + " Invoice", "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname

End Sub

Private Sub SaveReport_Click()

Do
Sheets(Array("Maintenance Data Sheet", "Field Activity Report", "Extended Note")).Copy
fname = Application.GetSaveAsFilename(Range("AX2").Text + " " _
+ Range("F12").Text + " " + Range("AL13").Text + " " _
+ Format(Range("AX1").Text, "yymmdd"), "Excel Files (*.xls), *.xls,All Files (*.*),*.*")
Loop Until fname <> ""
ActiveWorkbook.SaveAs fname

End Sub



Edit by Moderator:
Please post Excel questions, in the Excel forum.

Please use the [vb][/vb] tags when you post your code. Edit or reply to this post to see how.

Thank you.

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