[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Open a form through macro based on a value from combobox

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
grouper15
Asked:
grouper15
  • 2
  • 2
1 Solution
 
Ryan ChongCommented:
Try this:

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

i m not using VBA . i need to done that in Forms or Macros within the Access 2003 environment
0
 
aflockhartCommented:
after update event on combo box : run Macro1

MAcro 1:
Action : OPENFORM
Parameters:

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

0
 
aflockhartCommented:
... but if you want more robustness and error checking I'd go with VBA.
0
 
grouper15Author Commented:
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now