/    Sign up×
Community /Pin to ProfileBookmark

Saving form info

I would like to create a form. It is a check list that our supervisors have to fill out after every shift. I would like the Information saved as a Microsoft Word document instead of using the mailto command when the submit button is clicked. Is this possible ?

Thanks,
Debra

to post a comment
HTML

30 Comments(s)

Copy linkTweet thisAlerts:
@khakiApr 07.2003 — Hi Debra...

I'm not too sure that a Word doc is a reliable way of capturing data from a web app.

Can you use ASP and an Access DB instead?

You can always use the Access data to update your Word docs (or Excel spreadsheets) from the network level afterwards.

Let me know.

? k
Copy linkTweet thisAlerts:
@mascardrauthorApr 07.2003 — kahki...that would work. But to be honest...I'm not sure how to do that. I think I can create the form. It is a basic one...just text. Just name, location, comments. But how would I direct it to an Access database ? I would appreciate any help.

Thanks
Copy linkTweet thisAlerts:
@PeOfEoApr 07.2003 — um no... I dont think you can save it as a .doc you can do a .txt. The data base is basic to use. I mean you can use asp.net or asp and you would use a simple connection string but it would not just be making an html form you would have to do yout whole page in asp or asp.net, I dont know how to do it in asp but I can in asp.net. But you will need to make another page to display the data in the data base and another page to delete records and update them or you will have to download your data base each time you want to look at it or edit it. But I pretty sure you can update a .txt using form. Who is your host?
Copy linkTweet thisAlerts:
@khakiApr 07.2003 — Hi (again) Debra...

Peo is correct (he [I]doesn't[/I] know. lol ? ).

First question:

Do you have the ability to run ASP pages (IIS needs to be installed on the server).

oh... that's the [I]only[/I] question (lol)... the rest are statements (assuming that you [I]can[/I] run ASP pages on your server).

You only [I]need[/I] 1 page (an HTML page marked-up with ASP delimiters and code, and saved as an ASP page.... peo is misrespresenting things, so please don't get confused). This page will populate the database with the form data. That is fairly easy, and we can address it as we go.

By the way... are you on a Network where you have access to the server as well as the Network drives?

If so, the Access database is available to all of your MS apps (Word, Excel, etc) so you can just merge/link/etc directly from there.

If not... you can create a second ASP page that accesses and displays the data/info (also fairly easy).

Wanna try?

It's not [I]easy[/I]... but it's do-able if your adventurous.

Let me know...

? k
Copy linkTweet thisAlerts:
@PeOfEoApr 07.2003 — I still say saving it as a text is the way to go =D is that possible like what would that lookm like? I am .net guy like I said I dont know much asp classic
Copy linkTweet thisAlerts:
@khakiApr 07.2003 — well peo... i don't know [I]anything[/I] about ASP.NET... so there we are! lol

And if ASP is an option... a TXT file is like a covered-wagon vs an SUV... not even close!

Data needs to be [I]organized[/I]... not just collected. A TXT file collects, but it doesn't organize (or query).

You cannot compare the two [I]at all[/I].

Why would you even say :

[I][B]I still say saving it as a text is the way to go[/B][/I].

Are you punch-drunk or something ? ?

This - if possible - is an ASP/DB issue. I don't think it is wise to suggest any other method until (or if) it is determied that ASP/DB is [I]not[/I] a possibility.

that's my opinion (always free! lol)...

? k
Copy linkTweet thisAlerts:
@PeOfEoApr 07.2003 — well I know in vb (asp.net uses vb) it is very easy to edit a text file. I know it wont query it like a .mdb or sql data base but you can do some basic things by calling up the exact row and stuff like that but I mean all this person needs is to update the data and it would be a lot easyer to make a update page for one text file that (s)he can just go in and edit online then using an access mdb where (s)he has to eather make a oage to add a page to delete and page to edit the data, or roll them all together but that would be still more work. The way I see it this user does not need to query the data so the text file would be a time saver. Dont you think?
Copy linkTweet thisAlerts:
@mascardrauthorApr 07.2003 — Okay...I have an intranet so I do have access to my web server and network. I know nothing about ASP and don't know if my server has the capability. My web server is running Netware Enterprise server.

Here is my situation. I work for a law enforcement agency. At the end of every shift, the supervisors have to take count of inmates ect. I was told that the Major wanted the form they now use posted on the intranet. I made the form and have it sending the information to the Major's email. Problem is...he wants it to a file rather than his email. So I'm looking to maybe save the information to a text file. The easier I can make it for him the easier my life will be ? Suggestions ?

Thank you for all your help so far.
Copy linkTweet thisAlerts:
@PeOfEoApr 07.2003 — Well, make a very basic asp application and see if it displays. I would say a hello world application but khaki, can't ie read vbscript?
Copy linkTweet thisAlerts:
@khakiApr 07.2003 — okay Debra...

I think we are [I]golden[/I]!.

(we'll do some quick testing first just to make sure though).

Can we finish this tomorrow? (maybe I can hop back on later tonight and give you some stuff... we'll see).

I think that we can make you shine (and I'm always happy to help Law Enforcement. My Daddy was a career MP in the Marines).

I'll attach some files as soon as I can... but if you can provide me with your form... I can implement that directly into the page/DB for you... if you want.

I'll catch-up with you later (or sooner. We'll see).

? k
Copy linkTweet thisAlerts:
@mascardrauthorApr 07.2003 — PeOfEo...thanks for trying.:p

Khaki...I have attached my form. The form is working great when sent to email but hard for the Major to read.

Tomorrow is fine. I appreciate the time you are taking to help me.

Thanks for the support fo Law Enforcement ?

[upl-file uuid=ba61b2a4-9c8a-43cc-b977-15f1841ed54e size=1kB]jls.zip[/upl-file]
Copy linkTweet thisAlerts:
@khakiApr 08.2003 — Debra...

I took a look at your form...

That's a lot of fields!

27 (?) !

I see that you have a field (TIME) using an input with type=number

You need to change that to text (and we can probably automatically generate that value by using the local browser time, if you want)

Same with the date (we can decide that as we go).

I also see that you have names with spaces.

Those spaces need to go, or they can be substituted with underscores if you want.

No spaces though (underscores are fine though, so feel free to use them... but not dashes!).

You also have 19 text boxes for Comments/Concerns.

Access has a limit on character counts in it's fields (i hate that!).

You only get 255 characters (which is less words than you might imagine), so it may be necessary to break the comments up, or re-think this ASP/Access approach (or... do you have SQL Server at your disposal?).

How many characters do you think are typed into those Comments/Concerns fields?

Here is a link to a page for testing character counts:

http://www.1dot0.com/khaki/char_cnt.htm

You can use that to help determine if Access will work for you or not (although we can create multiple Comments/Concerns fields that we can concatenate if necessary).

What number of characters is normally the MAX for that field?

Since this is a really big form, I will really need you to create the database in Access yourself (I'm feeling generous.... but not [I]that[/I] generous). lol

Can you do that?

Remember...

1) No spaces in the filed names... and please make them match the names of each input on the form (exactly).

2) Set the proper data types

I'm sure that there is more... but I can't think of it now.

Lets work with what we have so far.

  • * Answer the questions that I've asked

  • * Change the forms names so that there are no spaces (send me the updated version)

  • * Create the Access Database table (send me the mdb file)


  • After that, I'll try to put it all together so that you can update the DB with the form data.

    Then we can talk about the methods of extracting it.

    Sorry that i didn't get back to you sooner... it was a strange day :rolleyes:

    Are you still up for this?

    Hope so.

    Let me know how you are doing and if you have any other questions so far.

    ? k
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 09.2003 — khaki...sorry I was called away from the office yesterday...sick child.

    Thanks for the heads up on the spaces and such. I will correct those. As of right now I'm still up for it...unless I hear otherwise from the Major. Expecting a phone call from him any minute. I will post in a bit.
    Copy linkTweet thisAlerts:
    @khakiApr 09.2003 — okay... great Debra...

    I'm embarking on a new project today (I actually have to travel to the office in about 30 minutes :eek: . boo-hoo ? .... but don't hate me because I usually get to work in my jammies! ? lol)... so I may be a bit sporadic in my responses from time to time (it depends on the scope of my new project.... and [I]yours[/I]... which may actually take [I]longer[/I]! lol)

    Anyway... get back to me when you can.

    I'll check back later.

    ? k

    (hope the wee-one is feeling better ? )
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 09.2003 — khaki you get to work at home ??!!??! Now that would be nice. I just don't think with spring here, I would have the disipline to work if I wasn't in the office. I would probably be on my bike riding.

    I understand about no time...not a problem. We will work on this when our schedules permit. By the way...if you don't mind me asking...what do you do that allows you to work from home ? Must be nice

    :p

    And thanks...my little one is feeling a little better today. She has cancer so when she feels good at all it is good. ?
    Copy linkTweet thisAlerts:
    @khakiApr 09.2003 — okay... so my new "project" is a piece of puff (Excel programming... and the guy that I'm doing it for will easily be a day or 2 behind me in trying to implement his piece into mine) so... it looks like time is on our side (right Mick? ? lol).

    (although I always seem to get these additional little nugget-projects... in order to keep me out of trouble - I guess :rolleyes: - so we'll have to work around those too, i suppose)

    So anyway... yes.. I work (mostly) from home these days (yay! ? ). The discipline aspect is easy (Daddy was a Marine... and I did not escape the gene. :rolleyes: lol). Plus... there is always plenty of time for play during the day (but it requires a lot of late night screen-time... for which I [I]do not[/I] complain! It's a 24 hour clock, and an 8 hour work-day is an 8 hour work-day somewhere within those other 24!).

    And... I'm so sad to here about your little girl ?. It breaks my heart ? ? ?.

    So listen... I'll create a mock-up Access DB and a mock-up form to submit the values.

    I'll forward them to you, and then you can then just follow the precedence and finish it.. ok?

    (focus on your little girl... not on this nonesense!)

    I'll try to get some of it done later (or tonite).

    Hang tight... I'll get back to you as soon as possible.

    suddenly sadder...

    ? k
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 09.2003 — okay...got word from the Major. Didn't like the output going to email. To hard to read. He wants the output to be in the same form as the input form. So I will get on correcting my form and then send it to you again and we can work from there.

    Work along with cycling is my escape from stress. When working on projects like this, it keeps the mind busy. And that is a good thing. You know how you can get caught up in something if you think about it to much ??!?? Work is a distraction. Thanks for the good thoughts.

    If you don't want to work on this on forum, let me know and I will give you my email address and we can correspond that way.

    Thanks khaki ?
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 09.2003 — khaki,

    I will correct the spaces in my form, change all fields to text, create the database and then zip it up. You don't need to create db, you have enough to do with your projects. I will name db fields just like the form. When I get those done which probably won't be until Thursday, I will send them to you. Sound good ?
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 14.2003 — Khaki...I haven't forgotten...just not given to the time to finish up. I will in the next couple of days. Still up for it ??
    Copy linkTweet thisAlerts:
    @khakiApr 14.2003 — Hi Debra...

    Sure. Whever. Just tell me when. ?

    ? k
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 14.2003 — Cool!!!!! Thanks
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 14.2003 — khaki,

    FInally created Access database with all fields named the same at the form. I also took all spaces out of names in the form. I zipped them up and am attaching them for you to look at. What is my next step ? I did look at some .asp code that passes data from a form to a database but got lost in it. Let me know what to do next.

    Thanks?

    zip file is to big with both files together so I'm sending them as two seperate files.

    [upl-file uuid=322b2e7b-8507-4c1c-8acd-299d5fd15c72 size=1kB]jlsfile.zip[/upl-file]
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 14.2003 — Database file is to big to attach !!!!!!
    Copy linkTweet thisAlerts:
    @khakiApr 15.2003 — don't worry about it Debra..

    as long as the form names match the field names.. i can do what i need to do.

    EXCEPT...

    I need to know the database name.. and the name of the table.

    After that... I can provide a page that writes the form data to the database... and another that reads the records from it (specific queries of specific records can be done in the next stage........ baby steps! lol)

    I have alot of mini-projects running right now... so bear with me (and if anyone else wants to lend a hand.. please do. I'm not in this for self glory... but to simply just to lend a hand... - so [I]any hand[/I] is always welcome to contribute ? ).

    ok Debra... i have 1 other priority in the morning (very important!). After that... it's between my boss and you (lol). But don't worry... I'll fit you in ?

    And once you see how your data is updated (and retrieved) to and from a DB... it's all downhill from there (seriously!!!).

    So.. till the morning...

    ? k
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 15.2003 — Khaki...good morning,

    I made sure that the field names in my Access database were exactly named the same as the field names in the form.

    Database name is jls.mdb and the table name is jls.

    Khaki...I appreciate your help so much. I spent the better part of yesterday trying to figure this out on my own and I have to admit, I got lost .

    Please don't apologize for having to work on your projects. I will take your help when I can. I honestly don't expect you to do this all for me. Please tell me how I can help with this.
    Copy linkTweet thisAlerts:
    @khakiApr 17.2003 — Hi Debra...

    Sorry that I didn't get back to you sooner, but apparently my boss has certain "expectations" that I actually

    produce work for the "Corporation" as well. LOL :rolleyes:

    Anyway... here is a scaled-down page that will attempt to connect to your DB and then write the records of the first 6 fields (as specifically entered by me below).

    Test this first (be sure to save it with an ASP extention) and see if it returns records ? or an error ? .

    [I][B](therefore, you need to have at least 1 record entered into each field of your DB... even if it's just bogus data for this test)[/B][/I].

    Since you have something like 27 fields... I only made a version which captures the first 6 (otherwise the data will scroll across the page OR you may encounter an error and it would be harder to pinpoint where the error exists).

    This will also force you to go in and play with the code... which should make it easier for you to get comfortable with it.

    You can (and should) test all of your fields (rewrite 6 at a time... or however you want to approach it).

    But... first let me know if the code spits data.... or errors.

    oh... and for this test, make sure that you place the ASP file in the same folder as the DB... or else alter this:

    [B]Server.MapPath("jls.mdb")[/B]

    to reflect where the DB is in relation to the ASP file.

    I know that this may seem "backwards"... but I want to make sure that we can connect and return records from your DB before we make the page that will populate the DB with the data from the form. You'll just have to trust me on that :rolleyes:

    And since I don't know the contents of the data itself, I also added a little CSS for some basic formatting of the data (to keep the returned records small enough to view AND fit on the page... hopefully).

    It's not essential... so feel free to 86 it if you want.

    Let me know how it goes.

    Good luck ?

    ? k

    [SIZE=1]

    <html>

    <head>

    <title></title>

    <style type="text/css">

    <!--

    #dataLoc {

    position:absolute;

    left:0px;

    top:0px;

    }

    td {

    font-family:verdana,arial,helvetica,sans-serif;

    font-size:10px;

    color:#cc0000;

    font-weight:normal;

    }

    -->

    </style>

    </head>

    <body>

    <%

    Dim conn

    Dim rs

    Dim strDBPath

    strDBPath = Server.MapPath("jls.mdb")

    set conn=Server.CreateObject("ADODB.Connection")

    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

    set rs=Server.CreateObject("ADODB.recordset")

    rs.Open "SELECT * FROM jls", conn

    %>

    <div id="dataLoc">

    <table border="0">

    <tr>

    <td><b>Oncoming Supervisor</b></td>

    <td><b>Supervisor Relieved</b></td>

    <td><b>date</b></td>

    <td><b>time</b></td>

    <td><b>Beginning Count</b></td>

    <td><b>Ending Count</b></td>

    </tr>

    <%

    Do While Not rs.EOF

    %>

    <tr>

    <td><%= rs.Fields("Oncoming_Supervisor").Value %></td>

    <td><%= rs.Fields("Supervisor_Relieved").Value %></td>

    <td><%= rs.Fields("date").Value %></td>

    <td><%= rs.Fields("time").Value %></td>

    <td><%= rs.Fields("Beginning_Count").Value %></td>

    <td><%= rs.Fields("Ending_Count").Value %></td>

    </tr>

    <%

    rs.MoveNext

    Loop

    %>

    </table>

    <%

    rs.Close

    Set rs = Nothing

    conn.Close

    Set conn = Nothing

    %>

    </div>

    </body>

    </html>

    [/SIZE]
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 17.2003 — hkaki...

    stupid question...how do you execute an .asp file ? When I save your file as an .asp file, how do I get it to run ? This is where I'm really lost.

    I'm anxious to test your code. Thank you again.
    Copy linkTweet thisAlerts:
    @khakiApr 17.2003 — Hi Debra...

    The server "executes" the ASP page... you don't need to do anything other than to place it on a server with IIS (which you said that you have).

    That's all.

    Save it...

    Put in on the server...

    Request it from a browser...

    ... and hopefully it works ?

    Let me know...

    ? k
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 17.2003 — okay khaki...I will give it a go. And your boss really made you work ?!?!
    Copy linkTweet thisAlerts:
    @mascardrauthorApr 22.2003 — hkaki,

    I'm having problems with my server. ASP is supposed to run on an Apache server according to Novell (which is the operating system on my server) but I can't get .asp files to execute. I'm also setting up a new server so as of right now I can't get the file you wrote to work. I will keep you updated.
    ×

    Success!

    Help @mascardr spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...