Add value First Record Only

fenhow

Registered User.
Local time
Today, 09:10
Joined
Jul 21, 2004
Messages
599
Hi, I have a main form with a subform. One to Many.

I am passing a value from the main form to an unbound control on the subform.

The trouble is I only want to add that value to the first record on the subform, not all if it happens to be a "many"

This is where I am so far but does not seem to work. Am I on the right track or is there a better easier way..
Thanks.
Fen

Private Sub Form_Dirty(Cancel As Integer)
If Me.Recordset.AbsolutePosition = 1 Then
Me.Text76 = [Forms]![ManagePaymentsF]![Text50]
End If
End Sub
 
Thank you, can I just use this on a form load or on dirty event in the form versus an append query? the field I want the value in is an unbound field on a subform.

Private Sub Form_Load()
If rec.Count = 0 Then
Text76 = [Forms]![ManagePaymentsF]![Text50]
End If
End Sub
 
Sorry, but the Value that populates an Unbound Control, on one Record, populates that Control on all Records...that's the way Unbound Controls work; off hand, I know of no way around this fact!

But perhaps if you give us a plain language explanation of exactly what you're trying to do, here, we can suggest something to help.

I assume that the code you posted is in the Subform...and the problem with that is that in a Main Form/Subform scenario, the Subform loads before the Main Form...so at that point in time, Text50 on the Main Form has no data!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom