How do I set a combo box to default blank field?

I have a combo box in Microsoft Access 2007 that obtains its list of values from a query.  What I want is for the combo box to initially set to a blank field.  I want to preserve the rowsource values being driven by the query (in other words, I don't want to switch to a Value List, as the values in the main db may change in the future and I don't want to manually key those in later on).

Is there a way to do this?

Thanks!
kmartinenkoAsked:
Who is Participating?
 
Tony HungateConnect With a Mentor Director of TrainingCommented:
It sounds like you probably would also want to place ="" in you on form open as well.  Depending on what you do with the form while you are running your report.

TLH
0
 
d_j_twilightCommented:
Questions:

1. Is it possible to include a blank in the selection query that generates the combo box list?

2. If the user doesn't make a selection (e.g. they leave that field as a blank when they submit the form, will that cause problems in your app?
0
 
kmartinenkoAuthor Commented:
d_j_twilight:
1.  No as the query is from a large table and it cannot and should not have any blank values.
2.  Perhaps, but its really for asthetic purposes to have the blank there.  I have a Me.combobox.requery afterupdate command that will reset the combo box after a procedure is performed (I am building a form that performs multiple queries and then generates custom reports).  I simply want the combo box to reset itself to a blank setting after the initial report has been executed, as to allow a new user or the same user to start over again with a new report.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
Rey Obrero (Capricorn1)Commented:
to clear the selection in the combo box,

me.comboName=""

that will make the combo blank
0
 
kmartinenkoAuthor Commented:
Capircorn1:

Thanks...but where do I place this command?  
0
 
d_j_twilightCommented:
In the "After Update" event procedure.

0
 
Rey Obrero (Capricorn1)Commented:
you already said it here ..

< I simply want the combo box to reset itself to a blank setting after the initial report has been executed, as to allow a new user or the same user to start over again with a new report.>

so after opening the report..

me.comboName=""
0
 
kmartinenkoAuthor Commented:
Yep, that was it.  Actually, I placed it in form load() instead of open but you jogged my memory as to what I have done in the past. I have done this type of stuff before but just had a major brain freeze...thanks for helping out.
0
 
Tony HungateDirector of TrainingCommented:
Glad that we could help.

TLH
0
 
Rey Obrero (Capricorn1)Commented:
just to let you know

an unbound combo box always is null when you open the form.,

so, can you tell me how you clear the combo after you run the report?
0
 
kmartinenkoAuthor Commented:
capricorn1:

Thanks, and yes, I realized that.  The combo box selections must be reset after the initial report is run, so I  included a Me.my_combobox.Requery command in the AfterUpdate() sub procedure.
0
 
Rey Obrero (Capricorn1)Commented:
so, why did you accept the comment at http:#a33697309 as an answer, when in fact you don't need it at all?
0
 
kmartinenkoAuthor Commented:
I needed the answer capricorn1...it may not have been the *exact* answer, but in the context of my situation, it worked for me, so I accepted a33697309 as the solution.  thats how I roll.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.