Solved

Open a form through macro based on a value from combobox

Posted on 2004-04-17
5
395 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
  • 2
  • 2
5 Comments
 
LVL 51

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

830 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