PC Review


Reply
Thread Tools Rate Thread

Code for "OK" in Dialog Box to lead to selected records in Form Vi

 
 
Natasha
Guest
Posts: n/a
 
      12th May 2010
Let's say that I have a "United States" Database with 50 records - each
record contains information about each state (i.e. population, state bird,
sports teams, governor's name, etc.)

Once the database is opened, the user will go to a switchboard, that
contains several search for lists (i.e search by state bird, search by
governor's name) Pressing any "search for" button will run a macro that will
lead them to a drop down menu for that category.

Now let's say that the user wants to see all records where the governor's
name is John Smith, and there are 5 states whose governor's name is John
Smith. What code do I enter in for "OK" in the dialog box so that when
users click "OK" after choosing "John Smith" , Access will show me only those
5 records whose governor is John Smith....BUT.....I want Access to show me
those records in a particular form IN Form View - not as a report.


 
Reply With Quote
 
 
 
 
golfinray
Guest
Posts: n/a
 
      12th May 2010
Let me ask a couple of questions. First, name is not very good to search on
at all because of just what you said: There may be several John Smith's. So
do you have anything unique to search on? Like a primary key, or if nothing
else, an autonumber field. In my opinion, you would need to have a unique key
ID for each state. Let's say Alaska's ID is 1000, Arkansas' is 2000,
Arizona's is 3000. Now you could set up 2 tables with a one to many
relationship. One would be the states. Many would be the information about
each state. Now in order to get that to work properly on a form, you set up a
foreign key. The ID is the Primary Key in the one table, and the foreign key
in the many table. Now you create a mainform and subform. The One side is the
mainform and the many side is the subform. Post back further questions, if
needed.
--
Milton Purdy
ACCESS
State of Arkansas


"Natasha" wrote:

> Let's say that I have a "United States" Database with 50 records - each
> record contains information about each state (i.e. population, state bird,
> sports teams, governor's name, etc.)
>
> Once the database is opened, the user will go to a switchboard, that
> contains several search for lists (i.e search by state bird, search by
> governor's name) Pressing any "search for" button will run a macro that will
> lead them to a drop down menu for that category.
>
> Now let's say that the user wants to see all records where the governor's
> name is John Smith, and there are 5 states whose governor's name is John
> Smith. What code do I enter in for "OK" in the dialog box so that when
> users click "OK" after choosing "John Smith" , Access will show me only those
> 5 records whose governor is John Smith....BUT.....I want Access to show me
> those records in a particular form IN Form View - not as a report.
>
>

 
Reply With Quote
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using '\' as the lead character in the "Save As" dialog =?Utf-8?B?U3RldmU=?= Windows XP General 9 10th Oct 2005 08:09 PM
Print default from "all" to "selected records" =?Utf-8?B?TGluZGEgTW9vcmU=?= Microsoft Access 0 12th Jul 2005 07:04 PM
Would like the "Print Range" default to be "Selected Records" =?Utf-8?B?RG9u?= Microsoft Access Forms 4 9th Jan 2004 12:51 PM
Would like the "Print Range" default to be "Selected Records" =?Utf-8?B?RG9u?= Microsoft Access Forms 0 4th Dec 2003 03:11 AM
Adding Records to a "Task" subform based on Item selected in Parent form... Cameo Microsoft Access Form Coding 2 13th Sep 2003 02:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 AM.