tag

S

sandrao

I read that the Tag property can be used to store a records value and upon
moving to the next new record fill in the forms control with the value stored
in that tab property.

How would I go about this? Can anyone give me an example on how to use it
and what can be stored and how to retreive it from the previous stored value?

I would like to use this to repeat the value in field e.g. "Agents Name" in
the same field in the next new record.

Sandrao
 
P

Pieter Wijnen

Something Like

Private sub Form_AfterInsert()
Me.Tag=Me.MyControl.Value
End Sub

Private Sub Form_Current()
Me.MyControl.DefaultValue = Me.Tag
End If

But I'd rather use:

Private Sub MyControl_AfterUpdate
Me.MyControl.DefaultValue=Me.MyControl.Value
End Sub

HTH

Pieter
 
P

Pieter Wijnen

To quick as usual
For a text field you'd need

Private Sub MyControl_AfterUpdate
Me.MyControl.DefaultValue="'" & Me.MyControl.Value & "'"
End Sub

and for a date field
Private Sub MyControl_AfterUpdate
Me.MyControl.DefaultValue="#" & Format(Me.MyControl.Value,"yyyy-mm-dd") &
"#"
' or the US date format Format(Me.MyControl.Value,"mm\/dd\/yyyy")
End Sub

"Pieter Wijnen"
 
S

sandrao

O.K. This might sound silly but Do I put the agents name in the Tag
Property e.g.
"John Doe". How does the new record retreve the Name from the previous record.
If the name "John Doe" appeared in the fileld "agentname" in record #1 how
do I get it to appear in record#2 field "agentName"?

Sorry for not understanding this feature

sandrao
 
Top