473,472 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help writing a double click event procedure

I have put together a db for a law firm to keep track of counterfeit
activities. There are four parent tables:

tblContact
tblTransaction
tblAction
tblFile

I have created a form, frmNewMatter, for adding new records to the db.
The form is based on tblFile and has a subform based on tblContact,
tblTransaction and tblAction. Essentially, frmNewMatter allows one to
input a new file number and the subform allows one to associate a
contact, transaction and action taken information to that file. In the
Contact section of frmNewMatter, one can either enter new contact
information or type in the tblContact primary key (an auto-number) in
the ContactID field which auto populates the contact fields on the
form. Because the pk is random and because the contact information by
its nature is incomplete (one record may only have an e-mail address
while another just a company name), I needed to include a search on the
form to allow users to search records in tblContact to determine the pk
associated with the preexisting contact. To solve this, I placed a
button on the form which opens frmSearch, a form I downloaded that
generates dynamic SQL (to search tblContact in the db) and assigns it
to a listbox on the form to show the results. I now want to be able to
create a double click event procedure which allows a user to click on a
result from the search and auto populate the form. So, I need code
which will say that on double click, enter the pk from the tblContact
and insert it in the ContactID field on the open frmNewMatter, thereby
obviating the need for a user to remember the pk and inputting it
manually. Any suggestions on the coding?

Nov 13 '05 #1
2 2679
Uninvisible wrote:
I have put together a db for a law firm to keep track of counterfeit
activities. There are four parent tables:

tblContact
tblTransaction
tblAction
tblFile

I have created a form, frmNewMatter, for adding new records to the db.
The form is based on tblFile and has a subform based on tblContact,
tblTransaction and tblAction. Essentially, frmNewMatter allows one to
input a new file number and the subform allows one to associate a
contact, transaction and action taken information to that file. In the
Contact section of frmNewMatter, one can either enter new contact
information or type in the tblContact primary key (an auto-number) in
the ContactID field which auto populates the contact fields on the
form. Because the pk is random and because the contact information by
its nature is incomplete (one record may only have an e-mail address
while another just a company name), I needed to include a search on the
form to allow users to search records in tblContact to determine the pk
associated with the preexisting contact. To solve this, I placed a
button on the form which opens frmSearch, a form I downloaded that
generates dynamic SQL (to search tblContact in the db) and assigns it
to a listbox on the form to show the results. I now want to be able to
create a double click event procedure which allows a user to click on a
result from the search and auto populate the form. So, I need code
which will say that on double click, enter the pk from the tblContact
and insert it in the ContactID field on the open frmNewMatter, thereby
obviating the need for a user to remember the pk and inputting it
manually. Any suggestions on the coding?

You can pass the key as an argument to a form. You can check for this
value in a manner like
If Not IsNull(Me.OpenArgs) Then

OpenArgs is a variant value.

See OpenForm for passing an arument. It is the last argument of OpenForm.

Also, you can refer to something like
Me.PKFieldName = Forms!SomeOpenForm!PKFieldName
Nov 13 '05 #2
What field do you want to search by. If every field has a name you just need
to put a combo box on frmNewmatter and bound it to ContactID in tblFile. The
combo box Wizard will do it for you .If you click combo box on tool bar and
draw the box where you want it. Select "I want combobox to look up value ina
table". Select tblContact from list. The fields from tblContact will
display. Select them all and it will show you them displayed with the
Primary key hidden. Leave it like this, even though it is the pk you are
looking for. Then select "store the value in this field" and select
ContactID ffrom the list and finish. You can search on whatever field is the
first field in the combobox query, (which you can modify as you please from
the combo rowsource property). As you type into the combo box it will look
through tblContact for a match in that field and when you select the name it
will automatically write the pk for that contact to ContactID on your form
John.

"Uninvisible" <gg*******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I have put together a db for a law firm to keep track of counterfeit
activities. There are four parent tables:

tblContact
tblTransaction
tblAction
tblFile

I have created a form, frmNewMatter, for adding new records to the db.
The form is based on tblFile and has a subform based on tblContact,
tblTransaction and tblAction. Essentially, frmNewMatter allows one to
input a new file number and the subform allows one to associate a
contact, transaction and action taken information to that file. In the
Contact section of frmNewMatter, one can either enter new contact
information or type in the tblContact primary key (an auto-number) in
the ContactID field which auto populates the contact fields on the
form. Because the pk is random and because the contact information by
its nature is incomplete (one record may only have an e-mail address
while another just a company name), I needed to include a search on the
form to allow users to search records in tblContact to determine the pk
associated with the preexisting contact. To solve this, I placed a
button on the form which opens frmSearch, a form I downloaded that
generates dynamic SQL (to search tblContact in the db) and assigns it
to a listbox on the form to show the results. I now want to be able to
create a double click event procedure which allows a user to click on a
result from the search and auto populate the form. So, I need code
which will say that on double click, enter the pk from the tblContact
and insert it in the ContactID field on the open frmNewMatter, thereby
obviating the need for a user to remember the pk and inputting it
manually. Any suggestions on the coding?

Nov 13 '05 #3

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

Similar topics

1
by: Dee | last post by:
I have a field "TerritoryID" on a subform. It has a Dbl Click event as follows: Private Sub TerritoryID_DblClick(Cancel As Integer) Forms!FmDealer5!Text152 = DealerID '**Retrieves DealerID...
6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
4
by: perspolis | last post by:
hi I manage a double click event in a combo box.. but this event doesn't fire ???? I don't know why??
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me...
2
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This...
5
by: sethuganesh | last post by:
hi, i have created a sample window aplication in VB.NET.placed a listview component in the form ,written click and double click event for list view.But the events are not fired.is there any...
4
by: Savita23 | last post by:
Hi, I have a subform in datasheet layout embedded in the main form.I want to invoke a procedure on the double click of each record in the subform.Is there a away by which I can fire the double...
4
by: raaman rai | last post by:
i wanna know if listview have the item double click event procedure in vb. pls enlighten me
4
by: Gandalf | last post by:
Hi every one. I need comprehensive tutorial for the following library : 1. pyWinAuto 2. winGuiAuto Thanks in advance
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.