this might be a very simple question but i really need an answer to it..thanks!
How can I make a report in Visual Basic using the data from a text file? I think I need to convert it to an xls or mdb file right? But how can I use Excel or Access to make a report in VB?
[Edited by chelle_1212 on 28-02-2003 at 01:01 PM GMT]
[Edited by chelle_1212 on 28-02-2003 at 01:04 PM GMT]
28-02-2003 at 02:23 AM
|
JLRodgers Level: Moderator Registered: 04-04-2002 Posts: 1658
Re: need help!
You forgot to post the question.
____________________________ Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
28-02-2003 at 04:27 AM
|
yronium Level: Moderator Registered: 14-04-2002 Posts: 933
Re: need help!
Just a couple of hints to start from.
Both Excel and Access allow to import data from a text file. You can do it manually by hitting the Import menu voice. By VBA is avaliable the DoCmd object, that can execute every Access/Excel menu command.
So, to run the Import command, you can try this (I did it in Access):
Private Sub btnCommand1_Click()
DoCmd.RunCommand (acCmdImport)
' The acCmdImport inner constant means the Import menu voice.
End Sub
After it, you can create a report and view it, by (still in Access):
Private Sub btnCommand2_Click()
DoCmd.RunCommand (acCmdNewObjectReport)
' (acCmdNewObjectReport = Insert|Report menu voice)
End Sub
Only, Im not sure you can create a report in Excel, I never tried it. To simply preview the sheet you must run another command, so the same method but a different inner constant (you can search it).
Hope it helps.
____________________________
Real Programmer can count up to 1024 on his fingers