473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Combo box not using default value

52
Hello!

I have a combo box that contains the Row Source

Expand|Select|Wrap|Line Numbers
  1. "Fall";"Winter";"Spring"
so that the instructor can select the semester they wish to look up a student's marks for. The Row Source Type is a Value List. As the default value, I have an IIF statement:

Expand|Select|Wrap|Line Numbers
  1. =IIf(Month(Date())>=8 & Month(Date())<=12,"Fall",IIf(Month(Date())>=1 & Month(Date())<=4,"Winter","Spring"))
the idea being that it (by default) displays the semester that we are currently in. The problem - it doesn't work! It always displays Fall! Any ideas as to why? Thanks in advance!
Jan 12 '11 #1

✓ answered by Rabbit

Use AND not &. Ampersand is the string concatenation operator.

3 1863
Rabbit
12,516 Expert Mod 8TB
Use AND not &. Ampersand is the string concatenation operator.
Jan 12 '11 #2
Mmmel
52
Oh my...feeling like an idiot!!! I knew that too!

Yeah, I think I need another holiday!

Thanks!
Jan 12 '11 #3
Rabbit
12,516 Expert Mod 8TB
No problem. You could also have done:

Expand|Select|Wrap|Line Numbers
  1. =IIf(Month(Date())>=8,"Fall",IIf(Month(Date())>=4,"Spring","Winter"))
Jan 12 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Terry Bickle | last post by:
Please forgive me for using the wrong term here or there. I'm an old Excel 4 macro guy who didn't convert to VB and I'm tinkering with an Access 2000 DB. I'm sure there is a simple Access 101...
3
by: Todd D. Levy | last post by:
I have a number of Drop Down Combo Boxes where users select a country; 99% of the time the selection will be "United States". I want to use VBA code in the New Record Event to populate this field...
3
by: ken | last post by:
Hi, I want to reset the default value of a combo box everytime someone selects something from its list. I have in the after update event combo.defaultvalue = combo.value. Anyhow this works, as...
6
by: carmela_wong | last post by:
Hello all, I am trying to set the default value of a combo box to "USA" which does not work although I have entered this in the Default Value property of the control. The combo box shows the...
6
by: JC21 | last post by:
Hi All, On my main table(tblCust) I have a field called Status, the default value is set to No. All the accounts currently in the table have a default value No. On my form I have a combo...
4
by: Torilyn73 | last post by:
I have a combo box set up off a query. I want the default value to be the column heading so I don't have to put a label over it. So far I haven't been able to figure this out. Can anyone tell me if...
2
by: Brad Pears | last post by:
In my vb.net 2005 project I have a few combo boxes where I want to set a default value. I am not binding these combo boxes - I am loading the values directly in code from a dataset. Obviously...
4
by: ARC | last post by:
I have a form with a first name and last name field right next to each other. The last name field has no label. I'm using: defaultvalue="" and defaultvalue =="" for new recs so a beginner-type...
10
by: Declining | last post by:
Hello All, I’d like to make an enquiry as to how to set the default value in a combo box to the previously select value in MS access 2003. I have 50 or so possible items that can be selected...
2
kmartinenko
by: kmartinenko | last post by:
Hi everyone, I have several combo boxes on my form, and while I have designated a column head, I cannot figure out how to default to the column head value. What I really want is for all of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.