Solved

Open a form through macro based on a value from combobox

Posted on 2004-04-17
5
396 Views
Last Modified: 2006-11-17
as an e.g
Table Structure

Person
{
id
Name
address
phone num
}



i have a form named "Search Name" it has a combo box named "cmbNameSearch" which is filled with Name column values of Person table . now at combobx click event i want another for m "Person Detail" to be opened which should display only those record whose Name colmun value is one which i selected in the combobox . i have a macro that i call on combobox click event that opens the detail form . but i am having trouble getting the desired result .

any help woud be appreciated .

Thanks

grouper 15

i filled the  combo box
0
Comment
Question by:grouper15
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 10849026
Try this:

if isNull(cmbNameSearch)=False and cmbNameSearch.value <> "" then
   docmd.OpenForm "YouFormName",acNormal,"Name = '" & me.cmbNameSearch.value & "'"
end if
0
 
LVL 3

Author Comment

by:grouper15
ID: 10849392
ryancys

i m not using VBA . i need to done that in Forms or Macros within the Access 2003 environment
0
 
LVL 17

Accepted Solution

by:
aflockhart earned 100 total points
ID: 10849710
after update event on combo box : run Macro1

MAcro 1:
Action : OPENFORM
Parameters:

formname =Person Detail
WHERE condition :  "[Name]=[Forms]![Search Name]![cmbNameSearch]"

0
 
LVL 17

Expert Comment

by:aflockhart
ID: 10849718
... but if you want more robustness and error checking I'd go with VBA.
0
 
LVL 3

Author Comment

by:grouper15
ID: 10852626
aflockhart i have got the hint from your reply of
[Name]=[Forms]![Search Name]![cmbNameSearch]

The actual thing can be done by altering the query criteria

but its not the correct answer any how u were the closet so i shall accept your answer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question