Sign Up |  Live StatsLive Stats    Articles 39,064| Comments 192,475| Members 20,192, Newest khepar777| Online 324
Home Contact
 (Forgotten?): 
    Chaar Sahibzaade
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags

RE: Memo Field

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 300 USD, Received: 0 USD (0%)
Please Donate...
       

Tags
memo, field
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 11-Nov-2005, 19:09 PM
Suzy's Avatar Suzy
Guest
 
Posts: n/a
   
   
RE: Memo Field

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi there... me again! Have been away for two weeks and come back to have
another go / continue with this database and have come up against a new
problem relating to the thread we have below...

When I go to enter a note for the first time for a customer (ie the customer
does not have any earlier notes in the history) I get the following run time
error '3201':

"You cannot add or change a record because a related record is required in
table 'Customers'. "

When I choose to 'debug' I am taken through to the Visual Basic window which
is pointing to the code you supplied below (in the immediate message before
this reply) and highlighting the line you added to solve the previous
problem...

"DoCmd.RunCommand acCmdSaveRecord 'forces record save"

I appreciate your ('idiots guide to') help with this problem as I am in
*way* over my head!

Many thanks,
Suzy


"Brian" wrote:

> I believe this is a record-locking issue. Silly me. I hadn't thought about
> that when I did the original example, because I had record locking turned off
> on my test db. When you open the current customer on your form, Access locks
> the record to prevent others from changing the information while you are
> viewing/changing it, and then the update query tries to update it; hence the
> error message.
>
> Instead, let's try just changing the contents of the Notes textbox directly
> on the form and then saving the record. This is much simpler, anyway. When
> you click your button, have this code instead:
>
> PostNotes_Click()
> If IsNull(NoteNew) Or NoteNew = "" Then Exit Sub
> If IsNull(Notes) Then 'do not insert blank line after new note
> Notes = Date() & Chr(13) & Chr(10) & [NoteNew]
> Else 'insert blank line between existing note and new note
> Notes = Date() & Chr(13) & Chr(10) & [NoteNew] & Chr(13) & Chr(10) & [Notes]
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/7158-re-memo-field.html
> End If
> NoteNew = Null 'blanks out new note, since it was just appended to Notes entry
> DoCmd.RunCommand acCmdSaveRecord 'forces record save
> End Sub
>
> Sorry about the confusion. This stuff is complicated enough without me
> introducing a piece of bad code...
>
> "Suzy" wrote:
>
> > OK I've put all that in but now it is having a run time error...
> >
> > Microsoft Visual Basic window says: "Run-time error '3188': Could not
> > updated; currently locked by another session on this machine"
> >
> > The options are to either 'End', 'Debug' or 'Help'.
> >
> > When I choose 'Debug' I'm taken through to the visual basic window and it's
> > showing me the code you provided earlier in this post to create a 'PostNotes'
> > button:
> > PostNotes_Click()
> > If IsNull(CustomerIDSelector) Or IsNull(NoteNew) Or NoteNew = "" Then Exit
> > Sub ' does not append blank note
> > DoCmd.SetWarnings False
> > DoCmd.OpenQuery "PostCustomerNotes" 'appends current note
> > DoCmd.SetWarnings True
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7158
> > Me.Refresh 'shows the newly-appended note
> > NoteNew = Null 'blanks out new note, since it was just appended to Notes entry
> > End Sub
> >
> > The error is pointed out / highlighted in this line:
> > DoCmd.OpenQuery "PostCustomerNotes" 'appends current note
> >
> > But I don't know why... like I said, I'm in WAY over my head here.
> >
> >
> >
> >
> >
> > "Brian" wrote:
> >
> > > I should have tried the new version first. Try this for the query instead:
> > >
> > > UPDATE CustomerNotes SET CustomerNotes.Notes = Date() & Chr(13) & Chr(10) &
> > > [Forms]![PostCustomerNotes]![NoteNew] & Chr(13) & Chr(10) & [Notes]
> > > WHERE
> > > (((CustomerNotes.CustomerID)=[Forms]![PostCustomerNotes]![CustomerIDSelector]));
> > >
> > > Also, unless this happens when closing the form, you will want to have
> > > something that clears the current note and refreshes the updated/prepended
> > > note so that the user does not accidentally click "Post" twice and end up
> > > with the same note in there twice. You will probably also want to ensure that
> > > the update does not happen if the user has not yet typed anything in the
> > > notes box: If IsNull(NoteNew) then Exit Sub on the line before the query runs.
> > >
> > >
> > > "Suzy" wrote:
> > >
> > > > I appreciate the help, and it's good despite the gap in the timeframe...
> > > > however there is one small problem... now when I click the Post Customer
> > > > Notes button the date goes in the top... and the memo text ends up appended
> > > > at the end of the memo field... like this:
> > > >
> > > > 19-Oct-05
> > > > 18-Oct-05
> > > > Note added 18-Oct-05
> > > > Note added 19-Oct-05
> > > >
> > > > AND... (but wait, there's more)... all of a sudden each new note I add is
> > > > being entered to EVERY customer...
> > > >
> > > > I'm in WAY over my head!
> > > >
> > > > "Brian" wrote:
> > > >
> > > > > It's been so long since I posted this that I forgot that I had done it (and
> > > > > mostly, what I said, also). However, yes there is a way to make the most
> > > > > current note go to the top. I have not tested this , but you should be able
> > > > > to just reverse the two portions of the Update query; move the [Notes] to the
> > > > > end of this:
> > > > >
> > > > > UPDATE CustomerNotes SET CustomerNotes.Notes = [Notes] & Chr(13) & Chr(10) &
> > > > > Date() & Chr(13) & Chr(10) & [Forms]![PostCustomerNotes]![NoteNew]
> > > > > WHERE
> > > > > (((CustomerNotes.CustomerID)=[Forms]![PostCustomerNotes]![CustomerIDSelector]));
> > > > >
> > > > > so that it looks like this instead:
> > > > >
> > > > > UPDATE CustomerNotes SET CustomerNotes.Notes = Date() & Chr(13) & Chr(10) &
> > > > > [Forms]![PostCustomerNotes]![NoteNew]
> > > > > WHERE
> > > > > (((CustomerNotes.CustomerID)=[Forms]![PostCustomerNotes]![CustomerIDSelector])) & Chr(13) & Chr(10) & [Notes];
> > > > >
> > > > > This should put the existing notes at the end of the memo field instead of
> > > > > the beginning.
> > > > >
> > > > >
> > > > > "Suzy" wrote:
> > > > >
> > > > > > Brian... this info has been great thank you! I was just wondering if there
> > > > > > is an easy way to make the new notes added appear at the top of the memo
> > > > > > field rather than being added to the bottom of the memo, so that the notes
> > > > > > appear in reverse chronological order?
> > > > > >
> > > > > > Eg: The most recent note goes to the top...
> > > > > >
> > > > > > 19-Oct-2005
> > > > > > Posted a question on memo fields.
> > > > > > 18-Oct-2005
> > > > > > Set up client database.
> > > > > > Etc...
> > > > > >
> > > > > > Many thanks (in advance)
> > > > > > Suzanne

> >





Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
   Click Here to Donate Now!
Related Topics...
Thread Thread Starter Forum Replies Last Post
Can I convert a OLE field to a Memo field? Guy Mann Information Technology 0 28-Jul-2006 08:39 AM
how do I limit the length of the memo field Harold Good Information Technology 7 28-Jul-2006 08:22 AM
Changing memo field DIH Information Technology 2 28-Jul-2006 08:21 AM
scrollbar in memo field. Stefan Information Technology 4 28-Jul-2006 08:20 AM
merging records into one memo field AMN Information Technology 2 28-Jul-2006 08:04 AM


Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Sufi-centric Musical...
Today 22:36 PM
3 Replies, 2,787 Views
Thought of the Moment!
Today 21:17 PM
324 Replies, 37,800 Views
Inner...
Today 21:15 PM
2 Replies, 73 Views
Re-birth of Guru Gobind...
Today 17:22 PM
24 Replies, 12,501 Views
SIKLIGAR: A Documentary...
Today 17:20 PM
1 Replies, 141 Views
Could this article be...
Today 06:02 AM
11 Replies, 531 Views
Soul
16-Dec-2014 22:29 PM
1 Replies, 194 Views
Siege in Sydney...
By Ishna
16-Dec-2014 07:42 AM
2 Replies, 221 Views
Sikhs For Change:...
By Ishna
13-Dec-2014 06:23 AM
173 Replies, 28,486 Views
Petition to President...
By linzer
12-Dec-2014 07:41 AM
0 Replies, 188 Views
We went to Gurdwara for...
10-Dec-2014 00:04 AM
3 Replies, 457 Views
Siropa Question
09-Dec-2014 23:29 PM
3 Replies, 369 Views
First Turbaned Sikh...
09-Dec-2014 23:17 PM
7 Replies, 761 Views
Charai Ved Hoey Sachiar
07-Dec-2014 23:49 PM
14 Replies, 949 Views
Chetan, Sentient,...
04-Dec-2014 00:08 AM
3 Replies, 409 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +5.5. The time now is 23:54 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-2015, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.46028 seconds with 34 queries