A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Default display in combox



 
 
Thread Tools Display Modes
  #1  
Old May 31st, 2004, 09:22 AM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default Default display in combox

How do I get a default value displayed in an unbound combo-box?

When I open the form, I'd like to be able to set an item from my
RecordSource to be displayed. When I click a cmdOK on that form, I'd like
that "default" to be the value of the combobox if the user didn't select
something different.

Thanks.

Gary


  #2  
Old May 31st, 2004, 10:15 AM
Michael
external usenet poster
 
Posts: n/a
Default Default display in combox

Hi Gary!
I guess you'll have to use VBA for your form's onLoad event.
You must insert these lines of code between "Sub... and ....End Sub"
procedure called when the form is being loaded.
Me.Combo1.Value = Dlookup("[Name of a column]","[Name of the table]", "set
of certain conditions to retrieve the default value")


"Gary Schuldt" wrote in message
...
How do I get a default value displayed in an unbound combo-box?

When I open the form, I'd like to be able to set an item from my
RecordSource to be displayed. When I click a cmdOK on that form, I'd like
that "default" to be the value of the combobox if the user didn't select
something different.

Thanks.

Gary




  #3  
Old May 31st, 2004, 04:54 PM
Gary Schuldt
external usenet poster
 
Posts: n/a
Default Default display in combox

Thanks, Michael!

My first application of the statement worked fine.

Gary

"Michael" wrote in message
...
Hi Gary!
I guess you'll have to use VBA for your form's onLoad event.
You must insert these lines of code between "Sub... and ....End Sub"
procedure called when the form is being loaded.
Me.Combo1.Value = Dlookup("[Name of a column]","[Name of the table]", "set
of certain conditions to retrieve the default value")


"Gary Schuldt" wrote in message
...
How do I get a default value displayed in an unbound combo-box?

When I open the form, I'd like to be able to set an item from my
RecordSource to be displayed. When I click a cmdOK on that form, I'd

like
that "default" to be the value of the combobox if the user didn't select
something different.

Thanks.

Gary






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.