By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,282 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,282 IT Pros & Developers. It's quick & easy.


P: n/a
Is there a way for a user to change a "default value" when entering a
form? I have a Shipment database that requires a name of the shipper
for each shhipment. When entering the form I need the user to type in
name and have that be the default for that back end database.

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
i'm not sure what you mean, but if you can say to a fild that its value
equal another field.

Or check in the tbl, you can enter the default values for a field.

Nov 13 '05 #2

P: n/a
Continuously changing the default value doesn't work that well. You
could autofill the control when the user clicks on it which will get
you similar results.
Lets say the control you want to change the default value of is named
txtShipment, and the name of the control that has the shipper is called
If you open your form in design vew, right click on txtShipment, choose
properties, choose the event tab, click the On Got Focus line and
choose [Event Procedure], then click on the elipsis (the button with
the 3 dots on the end of the line), it will take you to the vb window
and put you in an empty sub. The code below should do what you want.

Private Sub txtShipment_GotFocus()
If IsNull(txtShipment) Then 'don't change it if it's already
txtShipment = txtShipper
End If
End Sub


Nov 13 '05 #3

P: n/a
Thanks - that will work

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.