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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to find a record using more than one field?



 
 
Thread Tools Display Modes
  #1  
Old April 26th, 2010, 01:16 AM posted to microsoft.public.access.gettingstarted
Messen
external usenet poster
 
Posts: 2
Default How to find a record using more than one field?

I have created a table with several fields such as ID, name, date, etc. I
also created a switchboard with a find command to locate a record in forms
view . However the find command only searches under one field. Can I create
a find command that matches 2 fields? I want my find command to find a
record in form view that matches both the ID and date fields.
  #2  
Old April 26th, 2010, 02:18 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default How to find a record using more than one field?

Yes, it is possible. There are several methods that should work.

Can you post what method you used to for your find command? Then if you used
VBA code we can suggest a modification to the code.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Messen wrote:
I have created a table with several fields such as ID, name, date, etc. I
also created a switchboard with a find command to locate a record in forms
view . However the find command only searches under one field. Can I create
a find command that matches 2 fields? I want my find command to find a
record in form view that matches both the ID and date fields.

  #3  
Old April 26th, 2010, 05:35 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default How to find a record using more than one field?

It may only be a matter of semantics, but when you have a field named "ID",
the implication is that this is a unique row identifier. As such, you would
NOT need to do a find by both ID and "date fields", since the ID would
already be unique.

.... but maybe this isn't how you are using the field name...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Messen" wrote in message
...
I have created a table with several fields such as ID, name, date, etc. I
also created a switchboard with a find command to locate a record in forms
view . However the find command only searches under one field. Can I
create
a find command that matches 2 fields? I want my find command to find a
record in form view that matches both the ID and date fields.



  #4  
Old April 28th, 2010, 12:13 AM posted to microsoft.public.access.gettingstarted
Messen
external usenet poster
 
Posts: 2
Default How to find a record using more than one field?

I created a find record macro with three commands. (Real basic stuff here)
I used three commands. "OpenForm", then "GoToControl", then "RunCommand". I
then used a command button on the switchboard form to run the macro. The
problem here is, I have no VBA training. If VBA is required I would need to
know the whole code and how to link it to the comand button I quess.

I may be asking for more than my skill level is able to perform.


"John Spencer" wrote:

Yes, it is possible. There are several methods that should work.

Can you post what method you used to for your find command? Then if you used
VBA code we can suggest a modification to the code.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Messen wrote:
I have created a table with several fields such as ID, name, date, etc. I
also created a switchboard with a find command to locate a record in forms
view . However the find command only searches under one field. Can I create
a find command that matches 2 fields? I want my find command to find a
record in form view that matches both the ID and date fields.

.

  #5  
Old May 5th, 2010, 12:53 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default How to find a record using more than one field?

Sorry for the lack of response. I was out of town for a week.

You cannot use your method to search two fields simultaneously on two
different values. This will require VBA and a form to input the two values
you want to search for.

Do you want to limit the results to display to just the records that match
your criteria (filter the records)?


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Messen wrote:
I created a find record macro with three commands. (Real basic stuff here)
I used three commands. "OpenForm", then "GoToControl", then "RunCommand". I
then used a command button on the switchboard form to run the macro. The
problem here is, I have no VBA training. If VBA is required I would need to
know the whole code and how to link it to the comand button I quess.

I may be asking for more than my skill level is able to perform.


"John Spencer" wrote:



Messen wrote:
I have created a table with several fields such as ID, name, date, etc. I
also created a switchboard with a find command to locate a record in forms
view . However the find command only searches under one field. Can I create
a find command that matches 2 fields? I want my find command to find a
record in form view that matches both the ID and date fields.

.

 




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 10:31 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.