Default

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paul@tdsd.com

    #1

    Default

    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.

  • NomoreSpam4Me@hotmail.com

    #2
    Re: Default

    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.

    Comment

    • dedejavu@hotmail.com

      #3
      Re: Default

      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
      txtShipper.
      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_Got Focus()
      If IsNull(txtShipm ent) Then 'don't change it if it's already
      entered
      txtShipment = txtShipper
      End If
      End Sub

      HTH
      Pachydermitis

      Comment

      • pdemarais

        #4
        Re: Default

        Thanks - that will work

        Comment

        Working...