View Full Version : Passing a value


will
12-27-2001, 05:50 AM
Hello,
I have a main form that I record payement records in a text box each month. For certain months there are notes worth recording with the payment. I have a seperate 'Notes' form that opens with a text box that I use to enter notes. What I need is to copy and insert the values from the Notes text box, into the text box on my main form. Basically I need to pass the value between two forms. I get an error saying "Object required" when I try to pass it, my code looks like this:

Private Sub Command2_Click()

Dim x As String
'The Notes Form text box
Notes.SetFocus
x = Notes.Text

'Pass value to main form text box, with date
Me!PaymentHistory!Other.SourceObject
Other = Now() + x

End Sub

Chris RR
12-27-2001, 06:45 AM
Working without my own notes, I think that you need something like this:

Dim strNotes as String
strNotes = Now() & " " & me.Notes
[Forms]![MyMainForm]![Other] = strNotes

will
12-27-2001, 07:13 AM
I use the text box on my main form as a kind of history or previous payments. Is there a way to invoke a carriage return before I insert new data into the text box, so the newest entries will be at the top of the text box?

David R
12-27-2001, 11:55 AM
Another possibility is to have a linked table with a date field and a memo field. Then you can create a separate entry for each date's activity. If you create a button to make a Continuous Form (sorted descending by date) for this pop up, you will have something that looks very similar but might be more functional.

HTH,
David R