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  

Using a Combo Box to Find Records



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old November 17th, 2009, 12:47 AM posted to microsoft.public.access.forms
Scott_Brasted via AccessMonster.com
external usenet poster
 
Posts: 49
Default Using a Combo Box to Find Records

Jeanette,

Here is what is in imm. win:
First item on combo list is: Setup ID
But if I perservere and get past the error message, the correct data is in
the cbo.

SetupID is the autonumber primary key for the table for the main form. The
table is the list of fund raising campaigns and the field in the combo box is
the campaign name. I get the error: The value you entered isn't valid for
this field. Does it matter that there is a subform?

Thanks,
Scott

Jeanette Cunningham wrote:
Scott,
I am just getting back to this thread - it is 6am here in Australia.

This code--
Private Sub cboMoveTo_OnLoad()
Me.[cboMoveTo] = Me.[cboMoveTo].ItemData(0)
End Sub

is meant to make the combo show the first item that you would see if you
clicked on the combo. By the way, the line --
needs to be put in the Form_Load event.

The idea is that when the form load event runs, it puts that first item in
the combo.
The load event always runs when a form is opened.

Let's check out why this doesn't work for you.

In the code you have on the Form_Load event,
put this line
Debug.Print "First item on combo list is: " & Me.cboMoveTo.ItemData(0)

Now open the form.
Press Alt + G to open the Immediate window.
Look what access has put for the first item in the combo.

Let us know what access put in the immediate window.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Bruce,

[quoted text clipped - 107 lines]
Thanks,
Scott


--
Message posted via http://www.accessmonster.com

 




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 11:32 AM.


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