Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy from subform to Text box

Status
Not open for further replies.

Crownknox

Technical User
Apr 27, 2000
25
0
0
US
I have records for each product that we process at work. In a form, there is a field [TicketID]. Also in this field I have a subform from a query to show all other [ticketID]'s that were processed at the same time in the same machine.

Example: Current Form [TicketID] = 89100
Current Subform [TicketID] = 89101, 89102, 89103 ("Each on a different record in the subform")

I want to If[TicketID] in subform, then to copy "ALL" ticketID's to a field called comment: (Like the following: "This container was processed with 89101, 89102, and 89103")

Is this possible? I would appreciate any help?

 
Where do you wish this "comment" field.
In the subform?
In this case, you could build it using the RecordsetClone property in an event procedure of the subform (Load or Activate)

>>DIM Comment as String
>>Comment=""
>>Me.RecordsetClone.MoveFirst
>>DO WHILE NOT RecordSetClone.EOF
>>>>Comment=Comment & RecordSetClone!Ticket_ID & ", "
>>>>Me.RecordsetClone.MoveNext
>>LOOP
>>If Comment<>&quot;&quot; then
>>>>Comment=&quot;This container...&quot; & Comment
>>>>Me.Comment_TextBox=Comment
>>End If

I let you take care of the &quot; AND &quot; for the latest ticket
 
I want to put the comment on the main form. Would the same code apply?
 
Just to be clear. I have a field on the main form bound to the comment field with the same record as the ticketid on the main form.
 
What I'm trying to do is add all ticketid's in subform to the comments field on the main form.

Subform TicketID fields: 89100; 89102, 89103

MainForm Comments field: Processed with 89100, 89102, 89103

ANY HELP?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top