473,386 Members | 1,699 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,386 software developers and data experts.

Use double click event to jump to new form and filter data (Access 2003)

Hello,

I've created a subform that displays the results of a query. The
results of the query contain a unique ID named "Invoice_ID". I want to
be able to double click on a specific row in the subform to run a macro
which opens a new form and automatically "jumps" to the selected record
(note that the new form also contains a unique ID titled "Invoice_ID").

My preference is to accomplish this through a macro b/c I don't have
much experience with programming VB. However, at this point I am open
to anything.

Thanks :D

Mar 15 '06 #1
2 2357
Do it with VBA, not macros. It's much more powerful, and if you're
going to bother to learn, you might as well learn the better tool.

Here's a very simple bit of code that will do the trick. You can put
the same code behind every control on the subform, so the user can
double click anywhere.
Private Sub txtSomeField_DblClick(Cancel As Integer)
call DoCmd.OpenForm ("frmSomeForm", , , "Invoice_ID = " &
me!txtInvoice_ID)
End Sub

A better solution, though, would be to have one function that gets
called from each of those doubleclick events. That would look very
similar:
Private Sub OpenTheInvoice
call DoCmd.OpenForm ("frmSomeForm", , , "Invoice_ID = " &
me!txtInvoice_ID)
End Sub

Then the code behind each of the doubleclick events would look like
this
Private Sub txtSomeField_DblClick(Cancel As Integer)
call OpenTheInvoice
End Sub

There are tons of other ways to go about this, which is one of the
great (and sometimes frustrating) things about programming. Welcome to
our world. It's kind of fun.

Jeremy
--
Jeremy Wallace
Fund for the City of New York
http://metrix.fcny.org

Mar 15 '06 #2
Jeremy,

Thanks for the nice response and I appreciate your sample code. I'll
definately use it in the database.

Best,

Kelii

Mar 15 '06 #3

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

Similar topics

1
by: Dalan | last post by:
I probably just need a simple piece of code to do this as the couple tried so far have failed. I created a new Access 97 Form Filter (frmFilterForm) which displays most of the key data fields from...
7
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Access 2002 & 2003. Windows XP Professional O/S. According to the Access Help article "ApplyFilter Event" the "...ApplyFilter event occurs when...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
6
by: Boban Dragojlovic | last post by:
I have a webform that shows a long list of customers (500 - 1000) to the user. At the top of the form are various filtering options, including a quick search input box.
2
by: AA Arens | last post by:
I have a form with a combo account manager (choose the name) I have record navigation buttons on that form, along with other fields. I do not use queries, only tables. One of the tables is the...
10
by: jjstevens | last post by:
I have a form loaded and want to be able to double click on a field and have it pull up another form and filter it based on the value in the original form. What is the best way to do that. Access...
6
by: Jim Devenish | last post by:
I have an unbound form that displays all the days of the year as a calendar. It has 12 rows of text boxes with either 29,30 or 31 in each row. Text box names are of the form: display_01_01,...
5
by: David Wright | last post by:
Hello All I am using Microsoft Access 2003. I have an input form (Single Form) into which the clerk records appliance details. Some appliance details will never change, for instance the 'Make...
3
by: thayes5150 | last post by:
I have an Access 2003 database used to research unemployment claims. The main form contains a subform in datasheet view listing the employee claim records, including employee Social security number....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.