Paste problems

  • Thread starter Thread starter Derek Brown
  • Start date Start date
D

Derek Brown

Hi all

I have a button on a form that runs an update query that adds the current
forms data (mainly text) into a table supplying a note field on a subform.
The first form is a popup and the suform and main form are in the
background. What I am actually doing is copying a standard letters into my
subform to save repeatedly typing the same info. As the data has been added
by the update query when i close the popup and try to modify the new
contents of the subform the whole bloody lot vanishes. I can get it back by
undoing it but it seems that the data has not been saved. I have tried
requery, refresh and DoCmd Save etc but nothing works. Any Ideas?
 
Derek: This all sound a bit complex and hard to follow exactly what you are
doing.

If the goal is to paste a standard letter into a client record, have a table
that holds those standard letters. Use a combo box to select the standard
letter you want. In your standard letter combobox, column 1 might be "title"
and column 2 is "LetterBody" (no need to display). If you're on a client
record and want to paste the letter, you could simply put code like

Me.ClientLetter = Me.comboboxLetter.Column(1)

On either the after_update event of the combobox or a command button.
The above code will post whatever is in the 2ND column of the combobox
because it is base 0 (first column=0, second column=1).

HTH
 
Hi Sam

The letters to be pasted are on a popup form so that new standard letter can
be added to the Standard Letters table easily and can be modified or
improved at any time. The popup also has features like mailmerge etc. Having
buggered around with it now for a few hours what works is after the letter
has been appended to the subform table if i write code that moves the cursor
from the letter field on the subform to another field on the subform and
puts todays date in for example then (magically) i can now modify the letter
on the subform without it disapearing. In other words it appears that
entering data by append query is not saved until you programmatically move
to another field and modify that field. Then it prints and is saved without
problem. God this is weard!!
 
If you see a pencil on the left hand margin, the edit is not yet saved. If
you are writing code,
Me.dirty=false
will save the edit. Moving to another record will do it also.
 
Back
Top