473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

opening a form from a combo box

Hi folks.

I have a combo box with a list of names. I want to be able to click
(or press "enter" on) a name, which will open a separate form which
shows a group of records that corresponds to that name (e.g. "Borrow
History" table/query with its corresonding form, which holds the
details of books borrowed by that particular person). Any suggestions
on how I might be able to achieve this? Thank you.
Nov 12 '05 #1
2 5462
Aravind wrote:
Hi folks.

I have a combo box with a list of names. I want to be able to click
(or press "enter" on) a name, which will open a separate form which
shows a group of records that corresponds to that name (e.g. "Borrow
History" table/query with its corresonding form, which holds the
details of books borrowed by that particular person). Any suggestions
on how I might be able to achieve this? Thank you.


It's quite simple.

Use the value from the ComboBox (eg. PersonID) and build a Where value
to open the form with.

eg. (VB code) Docmd.OpenForm "frmMyForm",,, "[PersonID] = " &
Me![cboSelectPersonID]

(Check the position of the Where clause in the Help, I've guessed the
commas./etc above :)

You can use a macro to achieve the same thing if that is easier for you.

eg. In the macro enter something like this for the Where value on the
OpenForm action

"[PersonID] = " & Forms![MyForm]![cboSelectPersonID]

Hope that gives you a start...
--
regards,

Bradley
Nov 12 '05 #2
I have a similar thing to this previously by setting up a 2 column table
which links the name of the combo box option to a string that can be
executed using the VBA "eval" function. This table is the rowsource for the
combo box. The string to be executed should be your function which opens
the form, eg:

FormOpen ("Borrow History")
Function FormOpen (strFormName)
docmd.openform strFormName
'Assume that the Form's recordsource query already uses the borrower
name on the
' same form that the combo box is on.
end function
--

If you want more details just e-mail me

Cheers,
Bob Bykerk,
Principal Consultant
InformatIQ Pty Ltd
+61 - (0)419 44 77 03
+61- (0)2 93652520

"Aravind" <so**********@hotmail.com> wrote in message
news:61**************************@posting.google.c om...
Hi folks.

I have a combo box with a list of names. I want to be able to click
(or press "enter" on) a name, which will open a separate form which
shows a group of records that corresponds to that name (e.g. "Borrow
History" table/query with its corresonding form, which holds the
details of books borrowed by that particular person). Any suggestions
on how I might be able to achieve this? Thank you.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dixie | last post by:
I have a combo box on a form that contains some text of the type "Warning Letter 3" (this is the bound field). I want to take the last character from the contents of this combo box and place it in...
4
by: Rob | last post by:
Is it possible to have a field in a table ( A) such as social security # that takes a number as data. It is linked to a table (B) that has the Name and SSN in it for the combo box drop down with...
7
by: sara | last post by:
I have a form where the user selects an item from a list box, and then works on that item. The user chooses an AD, then opens a form to assign departments to the ad. The top of the Depts form has...
0
by: kellysc | last post by:
I have a table linked to an access mdb which I have set permission on for a specific set of users to update, delete, etc and another set of user to only select, but I need these users to be able to...
5
by: a Wellner | last post by:
I am trying to create a from that the user can select a street from a combo box (named street), then pick a second street from another combo box, containing only valid cross streets(named Cross). ...
3
Zwoker
by: Zwoker | last post by:
Hi Everyone, I have a query that uses criteria from combo boxes in the form that runs it. When I had only discrete values in the combo boxes that matched the data that was being queried, the...
0
by: Mr Gray | last post by:
HI guys, I am developing a winform and need to update the contents of a combo box at runtime. I currently click a button that brings up a new dialog and click save. I then return to the parent...
12
by: Laser Lips | last post by:
Hi, I have a select box and I'd like to open it from JavaScript. Is this possible? I don't think it is but just in case one of you knew. I've tried combo.click(); ..focus() ..select() Graham
6
by: MNNovice | last post by:
Question 1: I have a table called tblAccounts : fields are: AccountID (Auto), AcctNo (Text) and AcctDescr (Text) In my expese sub form, I am trying to auto populate a text box called txtAcctDescr...
1
by: Jules1334 | last post by:
Hi. I have a table called tbl_Employee with Two fields - EmployeeName and EmployeeID I have a form called frm_AuthEmployees where I need my user to pull down the EmployeeName from a combobox and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.