Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16

    finally!

    Quote Originally Posted by ssanfu View Post
    Attached is a text file that has the basic code () to import a text or csv file. You will also need the code from The Access Web at:

    http://www.mvps.org/access/api/api0001.htm




    Copy the code and paste it into a standard module. I named my module "modOpenSaveFile".

    You will have to figure out how to parse the input string, store the value in a variable, when to know you have reached the end of the data for a specific computer, how to create the SQL append statement. If you are going to update a record in a table, you will need to find the record then update the data.

    HTH
    ------
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)
    thank you so much! i will get started with that and let you know how i get on.

  2. #17
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by ssanfu View Post
    Attached is a text file that has the basic code () to import a text or csv file. You will also need the code from The Access Web at:

    http://www.mvps.org/access/api/api0001.htm


    Copy the code and paste it into a standard module. I named my module "modOpenSaveFile".

    You will have to figure out how to parse the input string, store the value in a variable, when to know you have reached the end of the data for a specific computer, how to create the SQL append statement. If you are going to update a record in a table, you will need to find the record then update the data.

    HTH
    ------
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)
    Hiya, I am trying to paste the code on that website but it i am struggling with it creating loads of different sub's? It is all the code in between the *****code starts here***** and *****code end*****

    really strugglgin with this as i know nothing about vb scripting

  3. #18
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What problems are you having?

    To recap:
    1) Create a new standard module (not behind a form).
    2) Copy the code between the
    ***** Code start ******* and ******** Code end******
    3) Paste it in the new module.
    4) Save the new module and rename it "modOpenSaveFile"
    You're done.

    Now you can use the standard Windows File Open/Save dialog box to select .csv file to import in your code.

  4. #19
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by ssanfu View Post
    What problems are you having?

    To recap:
    1) Create a new standard module (not behind a form).
    2) Copy the code between the
    ***** Code start ******* and ******** Code end******
    3) Paste it in the new module.
    4) Save the new module and rename it "modOpenSaveFile"
    You're done.

    Now you can use the standard Windows File Open/Save dialog box to select .csv file to import in your code.
    thanks for that! So i have made the module as you instructed, put the code from the attached .txt file into a macro builder for the button on click and comes up with

    Comile error: syntax error and its on Dim RF As Integer file handle

    surely this doesnt do anything? I am using access 2010 is this needed?
    Last edited by sliminconcoova; 09-08-2010 at 08:57 AM. Reason: add attachments

  5. #20
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    can any one answer this?

  6. #21
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    I have downloaded your last attachment. I will take a look and get back with you shortly.

  7. #22
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by HiTechCoach View Post
    I have downloaded your last attachment. I will take a look and get back with you shortly.
    thanks mate...i look forward to hearing from you.

  8. #23
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    I fixed the issues that were stopping it from compiling.

    I also imported the same data into a table.

    Where are you going to store this information?

    See the attached.

  9. #24
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by HiTechCoach View Post
    I fixed the issues that were stopping it from compiling.

    I also imported the same data into a table.

    Where are you going to store this information?

    See the attached.
    Hi, thanks for that! At least the box comes up now and you can select the audit's output. It now tells me though that 1335 lines have been found and processed but nothing gets put in.

    My question is, does this look for specific strings on the audit output or does it import everything?

    If it doesnt, can it do that or am I chasing my tail?

  10. #25
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Quote Originally Posted by sliminconcoova View Post
    Hi, thanks for that! At least the box comes up now and you can select the audit's output. It now tells me though that 1335 lines have been found and processed but nothing gets put in.
    The VBA code is only programmed to loop through the record. There is not any code set to store anything.

    Where will you store all the data? All I saw way a single table with only two fields (Computer Name and Domain Name). Is that really all you want to store?



    Quote Originally Posted by sliminconcoova View Post
    My question is, does this look for specific strings on the audit output or does it import everything?
    Currently there is only code to read all the records ion the file. There are comments int he code that show where additional code to process and store the data would go. There is not any executing code to save anything.

    Quote Originally Posted by sliminconcoova View Post
    If it doesnt, can it do that or am I chasing my tail?
    You will need to write the additional VBA code required to store the data.

    If it were mine, I would store everything from the file about a computer. I will also put a date/timer stamp on the data. This way when you run it again and import the data for a computer you will be building a history log.


    I see you only have a single table with two fields (Computer Name and Domain Name). Is that really the only two things you want out of all this data?

  11. #26
    sliminconcoova is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    Wiltshire
    Posts
    16
    Quote Originally Posted by HiTechCoach View Post
    I see you only have a single table with two fields (Computer Name and Domain Name). Is that really the only two things you want out of all this data?
    there will be more fields to store i just limited it to get an idea. This seems to be getting a bit too complicated to me, (although i know nothing about vba scripting etc)

    USing excel for an example. You can use lookup to find a value in column c for example and return the value in the cell in the same row. That is what i want to do.

    I understand there will may need to be a series of "lookups" as such, so when it finds the value it pastes it into the relevant field of a new record...

    i dont know how to simplyfy what i want lol...thanks for all your suport guys, really is appreciated

  12. #27
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Do you already have an Acces app created for tracking (storing) this information?

    It would help to see the actual tables for where you want to store all teh data.

    Would it be possible for you to attach a database with all the actaul tables that you will be using to store this data?

    Note: I say tables since this should be relational database. If properly designed to store this data it will require multiple tables.

    TIP: Avoid using spaes in tables and field names. Iy make writing queries and VBA code easier.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Question on Macro to automate file import
    By delkath in forum Access
    Replies: 4
    Last Post: 05-25-2010, 04:28 AM
  2. Macro To Import CSV to ACCESS
    By csvivek in forum Import/Export Data
    Replies: 1
    Last Post: 12-07-2009, 01:49 PM
  3. import custom form data from Outlook
    By bigsteve520 in forum Import/Export Data
    Replies: 0
    Last Post: 11-13-2009, 12:18 PM
  4. import using Macro
    By johnny1g in forum Import/Export Data
    Replies: 1
    Last Post: 09-15-2009, 04:21 AM
  5. Custom Import Tool
    By naoumaro in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2009, 08:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums