Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2005, 08:34 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get The Values In The DropDown

I have UserID(ie who has logged in) on the Main Form.

As I Open Form I want to Populate DropDown With ContactID Where UserID is Equal To UserID on the Main Form.

UserID and ContactID are in the Same table.

 I do not want to see All the ContactID but Only Those ContactID Where UserID is Equal to UserID on the Main Form.

OR

How I can Fill Data in The Comobox through code.
I Tried Combox.Value= and Combox.Text=
But it Does'nt Work

Can SomeOne Help Me.

Best Regards,
Vivek.
__________________
Best Regards,
Vivek.
 
Old November 30th, 2005, 09:13 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Go to the combo box properties dialog, then click the data tab and then open the query that populates the combo box.

Add this field to the query: UserID

If you don't modify the code that formats the combo box fields, then this added field will not show up when the box is searched.

Then add this criteria to the UserID field you just added to the query: Forms!frmMainFormName.UserID

This will prevent the combo box from showing records that do not belong to the UserID.

HTH


mmcdonal
 
Old November 30th, 2005, 09:45 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mmcdonal
 Go to the combo box properties dialog, then click the data tab and then open the query that populates the combo box.

Add this field to the query: UserID

If you don't modify the code that formats the combo box fields, then this added field will not show up when the box is searched.

Then add this criteria to the UserID field you just added to the query: Forms!frmMainFormName.UserID

This will prevent the combo box from showing records that do not belong to the UserID.

HTH


mmcdonal
I haven't Written Any Query in Properties of the Combo Box.
But I have got the ContactID of that USer through Code.
my Email ID is [email protected]
please do post any suggestion

Best Regards,
Vivek.





Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox values to dropdown december Classic ASP Professional 1 July 3rd, 2006 08:34 PM
Get The Values In The DropDown vivek_inos Access VBA 1 November 30th, 2005 04:17 PM
Dropdown values dotnewnewbie ASP.NET 1.0 and 1.1 Professional 5 October 28th, 2003 12:31 PM
update dropdown values mateenmohd SQL Server 2000 0 October 9th, 2003 03:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.