Solved

Open a form through macro based on a value from combobox

Posted on 2004-04-17
5
392 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 49

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now