-
saving a form
hello
well i have gotten this far...but now i am stuck again!
see post
http://forums.devx.com/showthread.ph...light=password
i have been able to develope my login form, it looks up the required values in an Access database and confirms/denies entry.i have set it up with 1 command button(on advice recieved here) so that once the people are confirmed as Valid, it then goes to Form2. now, on form 2 the user will fill in the correct areas, and then submit the form. here is the problem i have been trying to use SaveAs both from a command button and via the menuEditor (i would prefer the menu option since i would be able to include an Undo) but have been unable to figure the code
any assistance you could offer would be greatly appreciated
Thank you
Michael
-
Are you using the common dialog control(s)?
Can you post some code?
-
hello again
i am not using the common dialogue controls at this point
but am willing to follow whatever method would work best
i am at work right now , and therefore cannot post any code
as it is on my home machine
thank you
Michael
-
So are you trying to save an image of the form to a .bmp file? Or save the contents of a field/some fields into a .TXT/.CSV file?
-
Just re-read your 1st post. The best thing to do is to use a commondialog control, and save the values to file. Here is an EXAMPLE:
Code:
Public Sub cmdExport_Click()
On Error Resume Next
With CommonDialog1
.FileName = "" 'clear the file name as would be same as opened file (using same CDLG)
.Flags = cdlOFNOverwritePrompt
.Filter = "Text File (*.TXT)|*.TXT|Comma Seperated Values file (*.CSV)|*.CSV"
.DialogTitle = "Save to text file..."
.ShowSave
End With
Open CommonDialog1.FileName For Output As #1
Print #1, "Type,Start Address,Byte 1,Byte 2,Byte 3,Byte 4,Byte 5,Byte 6,Byte 7,Byte 8,Byte 9,Byte 10,Byte 11,Byte 12,Byte 13,Byte 14,Byte 15,Byte 16,CSUM";
Print #1,
For i = 0 To 18 'output 1st line onto one line seperated by a comma
Print #1, Text1(i).Text & ",";
Next i
Print #1, 'essentially a carriage return
For i = 0 To 18 'output 2nd line onto one line seperated by a comma
Print #1, Text2(i).Text & ",";
Next i
Print #1, 'essentially a carriage return
For i = 0 To 18 'output 3rd line onto one line seperated by a comma
Print #1, Text3(i).Text & ",";
Next i
Print #1,
Print #1, "Written by TexMex - Breakpoint, baseline, multiplier"
Close #1 'close the file
StatusBar1.Panels(1).Text = "Decimal data saved to file " & CommonDialog1.FileName
MsgBox "Decimal data saved to file " & CommonDialog1.FileName & " successfully!", vbOKOnly + vbInformation, "Success"
End Sub
This is for a different routine and application, but i'm sure you'll get the idea...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|