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 values in combo box with multiple colimns



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2009, 03:15 PM posted to microsoft.public.access.forms
mitja
external usenet poster
 
Posts: 5
Default default values in combo box with multiple colimns

Hi,
I have a combo box (cmbSEG_ETY_ID) that is filled with values from a table
SELECT RPT_EMPLOYEE_TYPES.ETY_ID, RPT_EMPLOYEE_TYPES.ETY_NAME FROM
RPT_EMPLOYEE_TYPES; (employee ID and employee NAME), where employee NAME is
visible and employee ID is linked column (column 1).
When a form opens a combo box is empty and a user has to select one product.
I want to change this so when a form opens, combo box would already have a
name of the first product NAME filed in and a product ID somewhere (?)

I tried to set Default value to:
=[cmbSEG_ETY_ID].ItemData(0)
doesn't work

I tried to use the load procedure Private Sub Form_Load():
Me.cmbSEG_ETY_ID.Value = Me.cmbSEG_ETY_ID.ItemData(0)
doesn't work

What to do?
Thanks
Mitja

  #2  
Old November 4th, 2009, 07:30 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default default values in combo box with multiple colimns

Open the form in design view, click on the combo, double click, scroll down,
and select Properties.
Enter an ID value in the Default Value property.

--
Build a little, test a little.


"mitja" wrote:

Hi,
I have a combo box (cmbSEG_ETY_ID) that is filled with values from a table
SELECT RPT_EMPLOYEE_TYPES.ETY_ID, RPT_EMPLOYEE_TYPES.ETY_NAME FROM
RPT_EMPLOYEE_TYPES; (employee ID and employee NAME), where employee NAME is
visible and employee ID is linked column (column 1).
When a form opens a combo box is empty and a user has to select one product.
I want to change this so when a form opens, combo box would already have a
name of the first product NAME filed in and a product ID somewhere (?)

I tried to set Default value to:
=[cmbSEG_ETY_ID].ItemData(0)
doesn't work

I tried to use the load procedure Private Sub Form_Load():
Me.cmbSEG_ETY_ID.Value = Me.cmbSEG_ETY_ID.ItemData(0)
doesn't work

What to do?
Thanks
Mitja

.

 




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 08:51 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.