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
  #21  
Old November 17th, 2009, 09:07 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Using a Combo Box to Find Records

In that case, it might be safer to use
Me.cboMoveTo = Me.SetupID

instead of

Me.cboMoveTo = Me.cboMoveTo.ItemData(1)


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Scott_Brasted via AccessMonster.com" u56211@uwe wrote in message
news:9f3fcce915429@uwe...
OK, I woke up this mornng withyet another idea. This
time it was a good one. I took Jeanette's code and replaced the
Me.[cboMoveTo]
= Me.[cboMoveTo].ItemData(0) with Me.[cboMoveTo] =
Me.[cboMoveTo].ItemData(1)
ans voila, magic and all that. Simple is great.

Mant thanks for for the persistance.

Best,
scott



Jeanette Cunningham wrote:
That combo searches using SetupID.
From reading through all your previous posts, I assume that the primary
key
of the form is something other than SetupID.
For the code line with ItemData(0) to work, the combo must search on the
primary key field of the form.

However, if the form has only value for SetupID when it opens,
you could try code like this--
Me.cboMoveTo = Me.SetupID

Put that one line of code in the Form_Load event.

If the form has more than one value for SetupID when it opens, the code
above won't work. If it doesn't work, leave the combo blank when the form
opens.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

Jeanette,

[quoted text clipped - 32 lines]
Thanks,
Scott


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1



 




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 06:23 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.