Results 1 to 4 of 4
  1. #1
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    Setting Default Value of a Combobox/Textbox


    I have several different options in a combobox that are the type of inventory adjustments, but when I open up my form for an incoming part, I want to have a hidden, bound combobox or textbox (whatever would work better) that has the default value set to "Incoming", which is the first option on the dropdown menu. I have tried setting the default value to this, but maybe I have the incorrect syntax. Is there any way to do this?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    If you're saying that you want the Combobox to be set to 'Incoming' if you're starting a New Record, this should do it:

    Code:
    Private Sub Form_Current()
      If Me.NewRecord Then
       Me.ComboBoxName = "Incoming"
      End If
    End Sub


    Simply replace ComboBoxName, in the code, with the actual name of your Combobox.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Thanks Linq!

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Glad we couldhelp!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automaticly Setting Default Value
    By swicklund in forum Forms
    Replies: 5
    Last Post: 06-17-2013, 08:08 AM
  2. Setting Variable Default for Combo Box
    By gazaway in forum Forms
    Replies: 5
    Last Post: 04-08-2013, 10:32 AM
  3. Replies: 4
    Last Post: 11-04-2012, 10:46 AM
  4. Setting default vaulue?
    By djclntn in forum Forms
    Replies: 17
    Last Post: 04-12-2012, 11:20 PM
  5. Setting the Default Value and Proper Case Example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 07:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums