don't know where to begin

cyraxote

Registered User.
Local time
Today, 00:17
Joined
Sep 19, 2002
Messages
20
Hi.

Here's what I want to do, but I don't know where to begin, and I don't even know if this is the correct forum

I am using Access 97.

I have a table containing information about articles to be published. The information includes contact info for the author(s), information about the article itself, and a number of date field for tracking the article's progress on the way to being printed. Each of the articles is assigned two unique numbers, one before it arrives at our location, and one by us.

I want to be able to find a specific record by searching on a number of things. If I have one piece of information about this article, I want to be able to quickly find the rest of the data. For example:

- if an author wants to know when his article is being published, I would like to be able to type his name into a box, and find the record for his article.

- if I know only the one of the unique numbers, I would like to be able to type either one in a box and get the whole record.

I don't know how to achieve this. A form? A query? Something else entirely?

Any help would be greatly appreciated.

Thank you.

Rodney
 
OK, this is how I would do it -

Create a form, no underlying tables or queries.
Create text boxes for as many types of fields as you to search on.
These will be UNBOUND text boxes.

In the AfterUpdate property for each of these text boxes write a piece of code like -


DoCmd.OpenForm "SearchResults", acNormal,,"[TableField1]=_" & Chr$(34) & Me!Textbox1 & Chr$(34)


If the field you are searching on is a numerical one, you do not need to use Chr$(34) since these are only used to surround text with additional quotes.

If you want to do this using a keyword that may be in the middle of a sentence then use -


DoCmd.OpenForm "SearchResults", acNormal,, "[Text]=_" & Chr$(34) & "*" & Me!KeyWord & "*" & Chr$(34)


This adds the wildcard symbol * to the keyword and finds all records that have the keyword embedded in it.

Sustitute [TableField] for the field in your table that you want searched.
Sustitute [Text] for the field in your table that you want searched.

The _ (underscore) symbol denotes a SPACE.

Create a second form "SearchResults" (maybe a pop up form with the relevant underlying table or query and populate it with the fields form the table or query.

When the second form opens it should show the required record.

If you have the "SearchResults" form as a continuous form, it could display all the records that meet the search criteria.

I hope this points you in the right direction.

Dave E
 
Last edited:
Dave:

That worked out great! I found that I could create one form with serach and result fields.

It was also very instructional.

I found that in this statement:

DoCmd.OpenForm "SearchResults", acNormal,,"[TableField1]=_" & Chr$(34) & Me!Textbox1 & Chr$(34)

I didn't need the quotes around

[TableField1]=_

Thanks very much for your help. Once you pointed me in the right direction, it became much simpler.

Rodney
 

Users who are viewing this thread

Back
Top Bottom