|
| |
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
Format of ' memo' field in access...? - 12/5/2002 10:17:14
Hi there, I have an access db which works nicely in my website. I use the DRW, tidied up with the spooky diet, which works well. However, in one field I want the user to be able to add notes to update the DB. These can be quite long, and so I' ve amended that field to be a ' memo' field in the DB. And that works well with only one problem. The database always returns the info in one long string; that is to say, if I wanted to put in info on one line and then put more info in on the next line, normally I would press the ' return' key on the keyboard and this would take me down onto the next line. And it looks fine on my web. Until I send it to the database and then pull the info back down later. Then there is no ' return' in the information and it comes back all as on one line. Is this post making my problem clear or is it all just gibberish? Anyway, as usual, all input gratefully received. Regards
_____________________________
***born to be wild***
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/5/2002 12:35:35
Thanks for that. I' ve checked in the DB and you are right, insofar as the carriage return is in there. So, as you say, it must be a question of getting the server to return it in the form you suggest. I' m guessing that somewhere now I have to get your code into my DRW code in the HTML page. Wish I was clever enough to know how to do that!!! Can anyone help???
|
|
|
|
rdouglass
Posts: 9272 From: Biddeford, ME USA Status: offline
|
RE: Format of ' memo' field in access...? - 12/5/2002 13:20:25
<%=Replace(FP_FieldVal(fp_rs," myMessageFieldName" ),chr(10)," <br>" )%>
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 4:38:27
That is excellent. It works a treat. At first I put that bit of code as well as the original code to call the description. The result was that I got the description - together with carriage returns where necessary - and then immediately another copy of the description without the carriage returns. So all I did was delete the original bit of code I had in, leaving the code..." <%=Replace(FP_FieldVal(fp_rs," S1" ),chr(10)," <br>" )%>" ... as noted by rdouglass and it works a treat. Thank you very much! Can I trouble you with one more related question? There is an ' update' administration section of my site. Basically, if you need to update a description you do it from this section. To avoid typing in the whole thing again, I currently populate the amendment form by using the " request" code, so that the form starts off being populated with the existing data. You may just want to change the spelling of one word, for example, and it would be a killer to have to type the whole description out again. You can probably see where I' m going with this. The code for this part of the form is as follows: " <td width=" 55%" valign=" top" align=" left" style=" padding-bottom: 2" bgcolor=" #FFFFFF" ><textarea rows=" 4" name=" S1" cols=" 24" style=" font-family: Verdana; font-size: 8pt" ><%=request(" S1" )%></textarea></td>" ...using the <%=request(" S1" )%> to populate the form. However, it doesn' t (of course) include carriage returns from the database, so I need to know how to get this form to include carriage returns while at the same time calling the data in " S1" ! Do you see the problem? Otherwise, each time I use the ' amendment' page to alter anything, it will lose any previously included ' carriage returns' . How can I do this? Many thanks in advance for your help...
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 5:03:39
I tried that but, unfortunately, it doesn' t work. I think the format..... <%=Request(FP_FieldVal(fp_rs," S1" ),chr(10)," <br>" )%> ..needs to have " Replace" rather than " Request" to make the chr(10) be replaced by the " <br>" on the page. But I don' t know how the syntax works enough to make the replacement work and then it be treated as a " request" in the form! But, (trying desperately to make this not sound condescending), thanks for trying!
_____________________________
***born to be wild***
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 5:15:49
Aargh. In my desperation I' ve even tried.... <%=Request(replace(FP_FieldVal(fp_rs," S1" ),chr(10)," <br>" ))%> ...but, of course, it doesn' t work. Perhaps I should go away and learn ASP properly. As Spooky keeps suggesting! In the meantime, if anyone can help, all suggestions gratefully received!
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 7:36:19
And I' ve even tried this.... <%=Replace(Request(fp_rs," S1" ),chr(10)," <br>" )%> ...Well, I' m trying, if nothing else!! Any clues anyone??
|
|
|
|
rdouglass
Posts: 9272 From: Biddeford, ME USA Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 10:30:48
You are trying to write back to the DB, No? If so, you' ll probably want to put it back in the same sort of ' state' it was originally. Now you' ll have to reverse the ' replace' and you' ll want to do it on the page that does the UPDATE. Something like this maybe: <%DIM myVariable, mySQL myVariable=Replace(Request(fp_rs," S1" )," <br>" ,chr(10) & chr(13)) ' then the update SQL code would look like mySQL = " UPDATE DISTINCTROW myTable SET S1 = ' " & myVariable & " ' WHERE RecordID = ::RecordID::" %> I think you were confused as to what gets replaced with what. In REPLACE function the syntax looks like: REPLACE(theTextBeingSearched, theTextYouWantToReplace, theTextYouWantToReplaceWith) Does that help??
< Message edited by rdouglass -- 12/9/2002 10:31:11 AM >
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 10:56:51
Hi rdouglass. Thanks, but I don' t think this is my problem. Can I put it another way? I have a db with vacancies in. So there may be job title, salary etc as fields. They are all fine. The only one I have a problem with is the formatting of a field called " S1" which is actually a description of the job. Here' s an actual example of what might be there... " The corporate department of a large national law firm are looking for an additional secretary to join the team. All applicants must have at least 2 years secretarial experience - legal preferred, and be familiar with handling diaries and workloads of extremely busy fee-earners. A pro-active approach and mutli-tasking skills are essential to be successful in this busy role. Excellent benefits and working environment." So, I put a break in the text by hitting the carriage return button twice while typing the job description after the words " fee-earners." before continuing with " A pro-active..." . And using the code you gave me earlier in this thread, it works fine. Great in fact. So that' s fixed for 95% of the time. But here' s the rub. If I want to change anything about this vacancy, be it salary, part of the description, or just a typo, anything, I have an amend form. This form is just like the original form I use to put the jobs in the database from in the first place, with the exception that I have it pre-populated with the data for this particular vacancy, using a hyperlink to pass the details to populate the form. For example, the hyperlink has one of each of the following parameters... <%=FP_FieldLink(fp_rs," S1" )%> to pass to the amend form to populate it. In the form itself, I use the following syntax to populate each form field... <%=request(" S1" )%> ....which works fine EXCEPT THAT the description box has lost it' s page breaks again. It' s not about getting it back into the DB, as I could go to this description box and manually put back in the breaks by pressing the carriage return, and that would reinstate them, but it isn' t AUTOMATICALLY doing it. And, as you can imagine, it' s not really practical to go through (nor would the users expect to) and manually put them back in each time an amendment is made. I' ve used this..... <%=Replace(Request(" S1" ),chr(10)," <br>" )%> ...which does still bring up the " S1" information, but doesn' t put in breaks... Am I making this clearer or worse!! I seem to be rambling! Do you see what I mean? Many thanks for your help so far!
|
|
|
|
rdouglass
Posts: 9272 From: Biddeford, ME USA Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 11:22:53
Either I' m not clear or I' m not understanding: When you populate the field for Editing, do the breaks show? Let me rephrase, where do they NOT show? See, I thought they weren' t showing when they go back to the DB; if you' re sending them back, you need to reverse the process: Replace(Request(fp_rs," S1" )," <br>" ,chr(10) & chr(13)) Lastly, if you' re using a <textarea> field in your form, you should not need to use the REPLACE function at all. I suspect that may be your problem at this point.... Does that help?
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 11:41:51
Hi, thanks for sticking with me on this. I think we' re so close to cracking it. The only place it doesn' t show is in the textarea of the form I use to update my vacancy details. When I' m in that form, if I go to the " S1" textarea and put in breaks, I can see them, I can submit them back to the database using the " UPDATE" results " SET" SQL statement and they certainly go to the database. I know this because: If I check in the raw access DB I can see the break and; If I use the " <%=Replace(FP_FieldVal(fp_rs," SI" ),chr(10)," <br>" )%> string (you recommended earlier in this thread) in the DRW that shows the public user of my site the vacancies, then the break is apparent. So I' m not having a problem getting the break into the DB. Nor am I normally having a problem getting the bread out of the DB and onto the page. The only place I have a problem is when I do this: 1. View a vacancy in the admin section of my site. This uses a DRW (spooky dieted and with the above string to show the break. AT THIS POINT I CAN STILL SEE THE BREAK. 2. Use the hyperlink at the bottom of the page " click here to amend this vacancy" which uses the following hyperlink... <a href=" amend.asp?ID=<%=FP_FieldLink(fp_rs," ID" )%>&title=<%=FP_FieldLink(fp_rs," title" )%>&Sector=<%=FP_FieldLink(fp_rs," Sector" )%>&type=<%=FP_FieldLink(fp_rs," type" )%>&location=<%=FP_FieldLink(fp_rs," location" )%>&salary=<%=FP_FieldLink(fp_rs," salary" )%>&salaryrange=<%=FP_FieldLink(fp_rs," salaryrange" )%>&date=<%=FP_FieldLink(fp_rs," date" )%>&S1=<%=FP_FieldLink(fp_rs," S1" )%>&email=<%=FP_FieldLink(fp_rs," email" )%>&company=<%=FP_FieldLink(fp_rs," company" )%>&contact=<%=FP_FieldLink(fp_rs," contact" )%>" > And posts to amend.asp, which has the amending form. In this form I have used the... <%=request(" S1" )%> ...format to pre populate the form. AT THIS POINT I CAN NO LONGER SEE THE BREAKS IN THE TEXTAREA. So this is where I' ve tried to use ... <%=Replace(Request(" S1" ),chr(10)," <br>" )%> ...but I can' t seem to get breaks to appear at this point. The interesting thing is this. I can' t see breaks at this point, and if I submit it back to the database, the breaks that were in the field (that could be seen in other parts of my site) will disappear. In other words, not only can I not see the breaks, but they aren' t there. If I type in more breaks here, either where they originally were or somewhere else, then they will be submitted to the DB and can once again be seen elsewhere on the site. I hope this makes it a bit clearer? Please stick with me on this one. The answer' s close I can feel it!! I just can' t see it!! Regards
_____________________________
***born to be wild***
|
|
|
|
rdouglass
Posts: 9272 From: Biddeford, ME USA Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 11:57:32
Is it necessary that you send all the info in a HyperLink? IOW can you just send the ID and repopulate the form data with a DB call? Sending your data thru a hyperlink (I think) is what' s causing the problem - you can' t send CR' s and LF' s thru them (IIRC).
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 12:12:12
I' m not married to the idea of sending all the info through a hyperlink, it' s just how I designed it in the first place using a spooky tutorial. And in fact if we' ve ascertained that' s the problem, I' d be happy to be divorced from it. If anyone can tell me how to populate the form using just the ID then I' d be absolutely delighted to do it! So near. And yet so far! Thanks for your help so far. Any further advice would be gratefully received!
_____________________________
***born to be wild***
|
|
|
|
Stuart at Cherry
Posts: 121 From: Leeds, West Yorkshire, UK Status: offline
|
RE: Format of ' memo' field in access...? - 12/9/2002 14:47:19
Hi, thanks very much. I' m at home now (we' re 5 hours ahead of you) and I' m about to read bedtime stories to my small children. However, I will give that a try first thing in the morning. By the time you wake up I will either have succeeded or failed!! I' m planning to use FP. I' m going to copy the form from the input page. Then I' m going to put a DRW at the top of it (but within the form). Then spooky diet it. Then cut and move the " <%=FP_FieldVal(fp_rs," myFieldName" )%>" bits into the appropriate part of the form. j And then see what happens! Thanks for your help. Tune in tomorrow for part 2!
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|