Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 18th, 2005, 09:42 AM
grangla grangla is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 grangla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 56 sec
Reputation Power: 0
Cool Populating a subform

I have a main form whose only feature is a single combo box. This combo box contains numbers corresponding to differrent personnel names. These numbers can occur in one of two fields in a record, but not both. I would like to be to populate the subform with all the records in which this number appears. Any ideas?

Reply With Quote
  #2  
Old March 18th, 2005, 10:23 AM
Anibal Anibal is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 176 Anibal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 20 m 48 sec
Reputation Power: 4
Hey grangla!
So you want to get from the DB all those people that have that number (in any of those two fields) ?
write down a query like

SELECT * FROM <your table> WHERE <field 1 with number> = <number in question> OR <field 2 with number> = <number in question>

For example:

Table: bla
Field1: IDemployee
Field2: SocialSN
Number in question: 32156

SELECT * FROM bla WHERE IDemployee = 32156 OR SocialSN = 32156

The value from the combo box in your main form would be the <number in question>.

Hope that's what you ment!

ANibal.

Reply With Quote
  #3  
Old March 24th, 2005, 02:28 PM
grangla grangla is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 2 grangla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 56 sec
Reputation Power: 0
Thumbs up

Thank you so much. Your fix worked very well!



Quote:
Originally Posted by Anibal
Hey grangla!
So you want to get from the DB all those people that have that number (in any of those two fields) ?
write down a query like

SELECT * FROM <your table> WHERE <field 1 with number> = <number in question> OR <field 2 with number> = <number in question>

For example:

Table: bla
Field1: IDemployee
Field2: SocialSN
Number in question: 32156

SELECT * FROM bla WHERE IDemployee = 32156 OR SocialSN = 32156

The value from the combo box in your main form would be the <number in question>.

Hope that's what you ment!

ANibal.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Populating a subform


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT