Hi, Leslie.
If you don't have any code interfering with how the text box gets its
DefaultValue Property, then you could try assigning it to the text box during
the form's OnCurrent( ) event for the new record. Try:
Private Sub Form_Current()
On Error GoTo ErrHandler
If (Me.NewRecord) Then
Me!txtVendorID.Value = Me!txtVendorID.DefaultValue
End If
Exit Sub
ErrHandler:
MsgBox "Error in Form_Current( ) in " & Me.Name & _
" form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear
End Sub
.. . . where txtVendorID is the name of the text box bound to the VendorID
field. If you cannot use the DefaultValue Property, then if the form that
opened the current form is still open and the VendorID value is displayed on
that form, then try the following line of code in the form's OnCurrent( )
event instead:
Me!txtVendorID.Value =
Forms("frmMyForm").Controls("txtOrigVendorID").Value
.. . . where frmMyForm is the name of the other form and txtOrigVendorID is
the name of the text box displaying the VendorID on that form.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.