Hi,
I am using a drop down system and would like a default value to appear in this drop down.
I have tried to do this but cannot work out how it is done.
see attachment.
Justin.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Default value in dropdown (2000)
You should be able to set the Default Value property of the combo box in the Data tab of the Properties window, but what exactly to put there depends on other properties of the combo box. If the Column Count property (in the Format tab of Properties) is 1, you should be able to enter the value you want to see in Default Value. If, however, Column Count is greater than 1, and the Column Widths property tells you that the first column has width 0, you should not enter the value you want to see, but the corresponding value of the hidden first column.
If you need more assistance, please provide the following information for the combo box (not as a screenshot, but as text in a reply):
From the Format tab:
– Column Count
– Column Widths
From the Data tab:
– Row Source Type
– Row Source
– Bound Column
When clicking on the dropdown list the default value does not appear to be showing , any ideas as to why not?
Information you required.
From the Format tab:
– Column Count: 0
– Column Widths: 2.54 cm
From the Data tab:
– Row Source Type: Table/Query
– Row Source: SELECT [Names Docs Review].[names] FROM [Names Docs Review];
– Bound Column: 1
You have set the Default Value property to
[Current Owner].[itemdata](“JACKSON Steve”)
This is meaningless (and not what Don Sadler intended.) Since you want a fixed value, you should set the Default Value simply to
“JACKSON Steve”
(including the quotes; if you omit them, Access will add them again.)
You have set the Default Value property to
[Current Owner].[itemdata](“JACKSON Steve”)
This is meaningless (and not what Don Sadler intended.) Since you want a fixed value, you should set the Default Value simply to
“JACKSON Steve”
(including the quotes; if you omit them, Access will add them again.)
When clicking on the dropdown list the default value does not appear to be showing , any ideas as to why not?
Information you required.
From the Format tab:
– Column Count: 0
– Column Widths: 2.54 cm
From the Data tab:
– Row Source Type: Table/Query
– Row Source: SELECT [Names Docs Review].[names] FROM [Names Docs Review];
– Bound Column: 1
You should be able to set the Default Value property of the combo box in the Data tab of the Properties window, but what exactly to put there depends on other properties of the combo box. If the Column Count property (in the Format tab of Properties) is 1, you should be able to enter the value you want to see in Default Value. If, however, Column Count is greater than 1, and the Column Widths property tells you that the first column has width 0, you should not enter the value you want to see, but the corresponding value of the hidden first column.
If you need more assistance, please provide the following information for the combo box (not as a screenshot, but as text in a reply):
From the Format tab:
– Column Count
– Column Widths
From the Data tab:
– Row Source Type
– Row Source
– Bound Column
This may not work in every circumstance but it works for me… In the combo box properties, data tab, default value, use the following:
[ComboBoxName].[itemdata](XXX)
where Comboboxname = the name of your combox and XXX = the row in your lookup table (assuming your combo box is based on a table or query) that contains your desired value. In determing the row, remember that it starts with zero.
I have been working on the same type of problem. However, I’d like my dropdown box to have a default value based on the value of another field (whether or not that field is “null”). example: IF txt2DefFullName is null then cboRespParty = “1Defendant”. AND I’d like this happen the the click event of a check box.
I’ve tried several things but no “hits” so far.
Charlotte
Let’s try to get the terminology straight. The Default Value property of a field determines the value this field will have in a new record, before data have been entered in that record. I’m not sure that is what you mean by “default value”. If txtDefFullName is bound to a field, it makes no sense to have the default value of another field depend on it. I also don’t understand what the check box has to do with it.
Thanks for your help, Hans. Understanding the definition of “defaut value” does help. So, now I’ll try to give you an understanding of what I’m trying to do.
I have a record in a table. There may be 1 defendant, or there could be 2. This record was created at some previous date.
Now, I have a new form (based on this old data) and I need to enter additional information. When the user does a search for a particular name, and then Selects this record as the one they want to deal with (clicking the check box “ckJGF”) THEN I’d like Access to analyze the data, if there is only 1 defendant (txt2DefFullName will be null) automatically enter “1Defendant” in cboRespParty (so the user doesn’t have to).
So, whether or not “1Defendant” is automatically “entered” into cboRespParty will depend on two things: 1) if txt2DefFullName is null and 2) if the user wants to work with this record (clicking ckJGF).
OK, this should be done (as you indicated in your first post in this thread) in the On Click (or After Update) event of the check box. The exact code depends on the way the combo box has been set up (like in Justin’s case). What are the following properties of cboRespParty?
From the Format tab:
– Column Count
– Column Widths
From the Data tab:
– Row Source Type
– Row Source
– Bound Column
both the drop down boxes have the same values
– Column Count = 2
– Column Widths = 1″; 0″
they are both bound to the same qry
All the other information is coming from a table “tbl1DebtorInfo” and corresponding qry
the check box “ckJGF” is bound to a Yes/No field on the table
txtDef1FullName and txtDef2FullName fields are bound to a qry based on “tbl1DebtorInfo”
I’ve combined three fields to make a Full name field
“Def1FullName: [fldDef1FirstName] & ” ” & [fldDef1MName] & ” ” & [fldDef1LastName]”
That that what you need?
I knew combo box was the official term, but everyone else was calling it a “drop down”, so I did too… monkey see, monkey do.
cboRespParty
– Row Source Type = Table/Query
– Row Source = qryRespParty
– Bound Column = 1
Thre are two combo boxes, exactly the same. One is on a subform.
subform name is sfrmJudgmentFees
As far as I can see from the information you provided, the following should do what you want:
– Open the form in design view.
– Select the check box ckJGF.
– Activate the Event tab of the Properties window.
– Click in the On Click event, and select [Event Procedure] from the dropdown list.
– Click the builder button (the three dots … to the right of the dropdown arrow.)
– Make the event procedure look like this:
Private Sub ckJGF_Click()
If Me.ckJGF = True And IsNull(Me.txt2DefFullName) Then
Me.cboRespParty = “1Defendant”
End If
End Sub
(You didn’t state that you want the combo box to be set to “2Defendant” otherwise, so the code does not do that.)
As far as I can see from the information you provided, the following should do what you want:
– Open the form in design view.
– Select the check box ckJGF.
– Activate the Event tab of the Properties window.
– Click in the On Click event, and select [Event Procedure] from the dropdown list.
– Click the builder button (the three dots … to the right of the dropdown arrow.)
– Make the event procedure look like this:
Private Sub ckJGF_Click()
If Me.ckJGF = True And IsNull(Me.txt2DefFullName) Then
Me.cboRespParty = “1Defendant”
End If
End Sub
(You didn’t state that you want the combo box to be set to “2Defendant” otherwise, so the code does not do that.)
I knew combo box was the official term, but everyone else was calling it a “drop down”, so I did too… monkey see, monkey do.
cboRespParty
– Row Source Type = Table/Query
– Row Source = qryRespParty
– Bound Column = 1
Thre are two combo boxes, exactly the same. One is on a subform.
subform name is sfrmJudgmentFees
both the drop down boxes have the same values
– Column Count = 2
– Column Widths = 1″; 0″
they are both bound to the same qry
All the other information is coming from a table “tbl1DebtorInfo” and corresponding qry
the check box “ckJGF” is bound to a Yes/No field on the table
txtDef1FullName and txtDef2FullName fields are bound to a qry based on “tbl1DebtorInfo”
I’ve combined three fields to make a Full name field
“Def1FullName: [fldDef1FirstName] & ” ” & [fldDef1MName] & ” ” & [fldDef1LastName]”
That that what you need?
OK, this should be done (as you indicated in your first post in this thread) in the On Click (or After Update) event of the check box. The exact code depends on the way the combo box has been set up (like in Justin’s case). What are the following properties of cboRespParty?
From the Format tab:
– Column Count
– Column Widths
From the Data tab:
– Row Source Type
– Row Source
– Bound Column
Thanks for your help, Hans. Understanding the definition of “defaut value” does help. So, now I’ll try to give you an understanding of what I’m trying to do.
I have a record in a table. There may be 1 defendant, or there could be 2. This record was created at some previous date.
Now, I have a new form (based on this old data) and I need to enter additional information. When the user does a search for a particular name, and then Selects this record as the one they want to deal with (clicking the check box “ckJGF”) THEN I’d like Access to analyze the data, if there is only 1 defendant (txt2DefFullName will be null) automatically enter “1Defendant” in cboRespParty (so the user doesn’t have to).
So, whether or not “1Defendant” is automatically “entered” into cboRespParty will depend on two things: 1) if txt2DefFullName is null and 2) if the user wants to work with this record (clicking ckJGF).
Let’s try to get the terminology straight. The Default Value property of a field determines the value this field will have in a new record, before data have been entered in that record. I’m not sure that is what you mean by “default value”. If txtDefFullName is bound to a field, it makes no sense to have the default value of another field depend on it. I also don’t understand what the check box has to do with it.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.