Dbl Click to open another form to a specific record

I would like to be able to double click on the field "ServiceCenter"
in a form called "Service_Call_Tracking" and open another form called
"Service_Centers" and have it display the record whose field
"ServiceCenter" matches the "ServiceCenter" field in the
"Service_Call_Tracking" database.

Further Information:  The form Service_Call_Tracking has a drop down
list field called "ServiceCenters" that displays all the Service
Centers Names listed in our "Service_Centers" Form.

I am a novice so please help me understand as well as help me figure
out the VBA code I need to create to make this happen.

0
serviceenvoy
2/24/2007 5:43:56 PM
access.formscoding 7493 articles. 0 followers. Follow

4 Replies
3830 Views

Similar Articles

[PageSpeed] 40

On 24 Feb 2007 09:43:56 -0800, serviceenvoy@gmail.com wrote:

> I would like to be able to double click on the field "ServiceCenter"
> in a form called "Service_Call_Tracking" and open another form called
> "Service_Centers" and have it display the record whose field
> "ServiceCenter" matches the "ServiceCenter" field in the
> "Service_Call_Tracking" database.
> 
> Further Information:  The form Service_Call_Tracking has a drop down
> list field called "ServiceCenters" that displays all the Service
> Centers Names listed in our "Service_Centers" Form.
> 
> I am a novice so please help me understand as well as help me figure
> out the VBA code I need to create to make this happen.

Look up the OpenForm method in VBA help files.
Also look up:
Where clause + Restrict data to a subset of records.

What datatype is the field [ServiceCenter]? Number? Text?

If it is a Number datatype, then:

DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = " &
Me.[ServiceCenters]

However, if it is a Text datatype, then use:

DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = '" &
Me.[ServiceCenters] & "'"

Remember that the bound column of a combo box may not necessarily be
what you see, so adjust the above code accordingly.

-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
1
fredg
2/24/2007 6:38:37 PM
Excellent.  It works with this string:

Private Sub ServiceCenter_DblClick(Cancel As Integer)
DoCmd.OpenForm "Service_Center", , , "[ServiceCenter] = '" & Me.
[ServiceCenter] & "'"
End Sub

Now, new problem.  One of my servicecenter fields has a ' in the field
and fouls up the command.  How could we build the command to search
for something like "Bill's TV" without getting stopped by the '
character (or other characters that might be in that field)?


On Feb 24, 12:38 pm, fredg <fgutk...@example.invalid> wrote:
> On 24 Feb 2007 09:43:56 -0800, serviceen...@gmail.com wrote:
>
> > I would like to be able to double click on the field "ServiceCenter"
> > in a form called "Service_Call_Tracking" and open another form called
> > "Service_Centers" and have it display the record whose field
> > "ServiceCenter" matches the "ServiceCenter" field in the
> > "Service_Call_Tracking" database.
>
> > Further Information:  The form Service_Call_Tracking has a drop down
> > list field called "ServiceCenters" that displays all the Service
> > Centers Names listed in our "Service_Centers" Form.
>
> > I am a novice so please help me understand as well as help me figure
> > out the VBA code I need to create to make this happen.
>
> Look up the OpenForm method in VBA help files.
> Also look up:
> Where clause + Restrict data to a subset of records.
>
> What datatype is the field [ServiceCenter]? Number? Text?
>
> If it is a Number datatype, then:
>
> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = " &
> Me.[ServiceCenters]
>
> However, if it is a Text datatype, then use:
>
> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = '" &
> Me.[ServiceCenters] & "'"
>
> Remember that the bound column of a combo box may not necessarily be
> what you see, so adjust the above code accordingly.
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail


0
serviceenvoy
2/26/2007 11:29:45 PM
On 26 Feb 2007 15:29:45 -0800, serviceenvoy@gmail.com wrote:

> Excellent.  It works with this string:
> 
> Private Sub ServiceCenter_DblClick(Cancel As Integer)
> DoCmd.OpenForm "Service_Center", , , "[ServiceCenter] = '" & Me.
> [ServiceCenter] & "'"
> End Sub
> 
> Now, new problem.  One of my servicecenter fields has a ' in the field
> and fouls up the command.  How could we build the command to search
> for something like "Bill's TV" without getting stopped by the '
> character (or other characters that might be in that field)?
> 
> On Feb 24, 12:38 pm, fredg <fgutk...@example.invalid> wrote:
>> On 24 Feb 2007 09:43:56 -0800, serviceen...@gmail.com wrote:
>>
>>> I would like to be able to double click on the field "ServiceCenter"
>>> in a form called "Service_Call_Tracking" and open another form called
>>> "Service_Centers" and have it display the record whose field
>>> "ServiceCenter" matches the "ServiceCenter" field in the
>>> "Service_Call_Tracking" database.
>>
>>> Further Information:  The form Service_Call_Tracking has a drop down
>>> list field called "ServiceCenters" that displays all the Service
>>> Centers Names listed in our "Service_Centers" Form.
>>
>>> I am a novice so please help me understand as well as help me figure
>>> out the VBA code I need to create to make this happen.
>>
>> Look up the OpenForm method in VBA help files.
>> Also look up:
>> Where clause + Restrict data to a subset of records.
>>
>> What datatype is the field [ServiceCenter]? Number? Text?
>>
>> If it is a Number datatype, then:
>>
>> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = " &
>> Me.[ServiceCenters]
>>
>> However, if it is a Text datatype, then use:
>>
>> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = '" &
>> Me.[ServiceCenters] & "'"
>>
>> Remember that the bound column of a combo box may not necessarily be
>> what you see, so adjust the above code accordingly.
>>
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail

DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = """ &
Me.[ServiceCenters] & """"

Just for clarity, that's:
 "[ServiceCenter] = " " " & Me.[ServiceCenters] & " " " "
 
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
2/27/2007 12:18:13 AM
On Feb 26, 7:18 pm, fredg <fgutk...@example.invalid> wrote:
> On 26 Feb 2007 15:29:45 -0800, serviceen...@gmail.com wrote:
>
>
>
>
>
> > Excellent.  It works with this string:
>
> > Private Sub ServiceCenter_DblClick(Cancel As Integer)
> > DoCmd.OpenForm "Service_Center", , , "[ServiceCenter] = '" & Me.
> > [ServiceCenter] & "'"
> > End Sub
>
> > Now, new problem.  One of my servicecenter fields has a ' in the field
> > and fouls up the command.  How could we build the command to search
> > for something like "Bill's TV" without getting stopped by the '
> > character (or other characters that might be in that field)?
>
> > On Feb 24, 12:38 pm, fredg <fgutk...@example.invalid> wrote:
> >> On 24 Feb 2007 09:43:56 -0800, serviceen...@gmail.com wrote:
>
> >>> I would like to be able to double click on the field "ServiceCenter"
> >>> in a form called "Service_Call_Tracking" and open another form called
> >>> "Service_Centers" and have it display the record whose field
> >>> "ServiceCenter" matches the "ServiceCenter" field in the
> >>> "Service_Call_Tracking" database.
>
> >>> Further Information:  The form Service_Call_Tracking has a drop down
> >>> list field called "ServiceCenters" that displays all the Service
> >>> Centers Names listed in our "Service_Centers" Form.
>
> >>> I am a novice so please help me understand as well as help me figure
> >>> out the VBA code I need to create to make this happen.
>
> >> Look up the OpenForm method in VBA help files.
> >> Also look up:
> >> Where clause + Restrict data to a subset of records.
>
> >> What datatype is the field [ServiceCenter]? Number? Text?
>
> >> If it is a Number datatype, then:
>
> >> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = " &
> >> Me.[ServiceCenters]
>
> >> However, if it is a Text datatype, then use:
>
> >> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = '" &
> >> Me.[ServiceCenters] & "'"
>
> >> Remember that the bound column of a combo box may not necessarily be
> >> what you see, so adjust the above code accordingly.
>
> >> --
> >> Fred
> >> Please respond only to this newsgroup.
> >> I do not reply to personal e-mail
>
> DoCmd.OpenForm "Service_Centers", , , "[ServiceCenter] = """ &
> Me.[ServiceCenters] & """"
>
> Just for clarity, that's:
>  "[ServiceCenter] = " " " & Me.[ServiceCenters] & " " " "
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail- Hide quoted text -
>
> - Show quoted text -

So, this now works perfectly:

Private Sub Service_Center_DblClick(Cancel As Integer)
DoCmd.OpenForm "Service_Center", , , "[ServiceCenter] = """ & Me.
[RepairCenter] & """"
End Sub

Now, on to the next project :)

I would like to see if I can create a function that would display the
same information in a small pop up balloon/window without actually
having to go to the entire record in the other form.  It would be nice
to point at the service center with the mouse and a balloon pop up
some basic information like phone number, fax number, email.  It would
be helpful if we could perform both functions.  This would involve the
exact same forms and only add in the additional fields of phone, fax,
& email from the service_center form.

0
serviceenvoy
4/3/2007 2:34:16 AM
Reply:

Similar Artilces:

Use Form to prompt for report criteria
I have a form that I am using to prompt for report criteria. When I run the query outside of the form, it works fine - prompting me for both criteria. However when I run from the form, I get #Error#. Can you see what I am doing wrong? Thanks in advance. I have two combo boxes that I have put in my underlying query. In the fields of the query are: [Forms]![frmSelection Criteria Form]![OfficeNumber] [Forms]![frmSelection Criteria Form]![Manager] *** On the OnClick event is the following: Private Sub Command6_Click() On Error GoTo Err_command6_Click Dim stDocName As String st...

Creating array of specific object types dynamically
Hi, little gotcha. Some COM objects requires array of specific type. To give you example, following DOESN'T work: [array]$X = @() However below code works: [int32[]]$X = @() For my framework, array type can be dynamic and I don't know in advance what type it's going to be. So what I would need is below: [$PropertyType[]]$X = @() This doesn't work with error message "Unable to find type". As a workaround, I solved it using following: Invoke-Expression "[$$PropertyType[]]`$Var = @()" This code works as expected, I am just curious if ...

Sending email messages without clicking the Send & Receive bu...
Is there a simple way to tell Outlook to send outgoing messages automatically when you click the "send" button? Sometimes I have to click the "Send and Receive" button after I click "send." On Sun, 13 Mar 2005 19:03:01 -0800, "NewUser" <NewUser@discussions.microsoft.com> wrote: >Is there a simple way to tell Outlook to send outgoing messages automatically >when you click the "send" button? Sometimes I have to click the "Send and >Receive" button after I click "send." Since you don't say what vers...

moving payables data from open to history
Hello: A client says that someone imported data about a year or two ago into Great Plains from their AS400. Many payables documents that were imported should have been coded during the import as open, instead of history. The client knows that she can take care of this herself within two hours, by simply turning off the posting to the GL and entering and posting the payables documents to move them to history. But, she is wondering if there is a quick and easy way to do this on the back-end. I'm familiar with the open and history payables tables within GP. And, I know through a T...

SharePoint (WSS) 2007 / Outlook 2007 - Alert
This is a multi-part message in MIME format. ------=_NextPart_000_00AD_01C70E47.83B45950 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We have setup a SharePoint Server (WSS) 2007 and are using the alerting = functionality. After we changes stuff on WSS, an alert message is generated and sent to = an email account. This e-mail account is hosted on an Exchange 2003 server. When using Outlook 2007 to open the e-mail, we get: Cannot open this item. Wenn using OWA the e-mail can be opene fine. Does somehow have an explanation for th...

Yet another duplicate record dilemma
I have a table with records where one field are duplicates. I'm able to query to find duplicates and delete them, however what I need to do is find the duplicates, produce a total from another field, delete the duplicates and update the record field with the new total. Use the Find duplicates wizard, the build an Update query and either add to the field: Update MyTable Inner Join Querty1.ID On MyTable.ID Set MyField = MyField + Query1.MyField or just update it: Update MyTable Inner Join Querty1.ID On MyTable.ID Set MyField = Query1.MyField Then delete the duplicate data. -- Ar...

disable Review toolbar which came up automatically when opening a.
How can I disable the Review Toolbar which comes up automatically when opening a file? In the Workbook VBA actions. The top left hand corner there is an Excel logo, not the one in th blue program bar, but in the menu bar. Right Click and select "View Code" There will be two drop down boxes one that will probably say General if this has never been entered previously. Change the box on the right to Workbook. Then Change the right hand box to "Activate" Insert the following code Application.CommandBars("Reviewing").Visible = False exit the VBA screen and t...

Insert,Update Data in sage (MS Access Linked tables) using Vb.net form
Hi folks, I am developing application using vb.net which requires integration with SAGE LINE 50 (Accounting software ) V11... The data which SAGE is using is MC ACCESS 2003 database... with linked tables in it... Now I Have developed the Sage connection using ODBC which works fine when reading the record but cannot Add or Update record into the Linked tables.... When i debug the program the error is at the line where it has... <br> MyodbcCommand.ExecutenonQuery() <br> Can anybody Help ????? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/acce...

"the wizard is unable to open your query in datasheet mode, possi
"the wizard is unable to open your query in datasheet mode, possibly because another user has a source table open in exclusive mode. your query will be opened in design view" what this message mean ,and how can i solve it Hi - Please provide more details as to what you are doing when you get the error, what your database setup is (i.e. split Fe/BE?, multiuser?, version? etc). Without more information, we can only guess. Thanks - John amr wrote: >"the wizard is unable to open your query in datasheet mode, possibly because >another user has a ...

Filling Web Form
Dear freinds Hello, I have written code in vc++ using MFC to fill the Webform using HTTP post method and I'm able to fill the form but I'm facing a problem that I'm unable to fill login name and password. So any one amongst you have any Idea or help then please help me With Regards Sachin ...

How to make a Add key disabled after adding one record unless
Hi, I have a form where I am adding records. There are two boxes where one has to put the lineitemnumber and another box where one has to put the description. Unless the above two boxes are filled in the Add command box need to be disabled. Now, the problem is after adding one record the Add button is enabled and I cannot disable it. I would appreciate any help to solve this. The error message is: The methos is not supported The following is the code: Private Sub cmdadd_Click() On Error GoTo Err_cmdadd_Click If (IsNull(Me.LineItemID) = True) Or (IsNull(Me.Description) = True) Then ...

Add new record through Form view
I have a table which is linked to a form, i would like to have a command button which will add a new record to my table. On the click of command button it should view the last empty row of my table in a form. On Sat, 26 Dec 2009 11:11:01 -0800, Ranjith Kurian <RanjithKurian@discussions.microsoft.com> wrote: >I have a table which is linked to a form, i would like to have a command >button which will add a new record to my table. >On the click of command button it should view the last empty row of my table >in a form. The Click event should show [Event Proced...

Excel 2000 vs. Excel 2002
I am having troubles with a workbook that I created that is havin problems opening. I created it in 2002, and it opens fine in Excel 2002 for other people However, when I send it to someone who has Excel 2000, it takes over a hour to open. Now I also made a very similar report that works just fine whe trasferred to excel 2000. Here are a couple of stats on the workbook that is having problems: 1.5mb 500+ externel links 500+ subtotals 200+ simple calculations (a1+b1; a1/b1;etc..) 1 Worksheet in the book. 2 columns with conditional formatting Thanks, Joh -- Message posted from http://ww...

Querying multiple records in two tables
Hi, in my database I have tables for users (UserID, UserName), projects (ProjectID, Project Name), and qualifications (QualID, QualName). I have join tables for users_qualifications (UserID, QualID), and projects_qualifications. (ProjectID, QualID). What I need to do is run a query for a project to show which users have the exact matching qualificiations. Users can have many qualifications, projects can require many qualifications, users may only work on a project if the qualifications required/held match exactly. Please help. Assuming that ProjID, and QualID are numeric, the following sho...

Messenger emoticons
I have changed laptops and I did grab the old laptops custom emoticons folder (all in dt2 and id2 file endings.) But when i copy everything in the folder and add it to my new laptops custom emoticons folder... they get added (i.e. show up in the folder) but the images/gifs or names dont show up on the actual msn... *what gives*? Do I have to change the dt2 endings to gif or jpeg and go to "create" in msn for each of them to add them in? (I tried with one and it worked) Only problem is i have alot, like 203 dt2 files so changing the ending to .gif and adding each singu...

Office 2004 issue with documents NOT BEING ABLE TO OPEN APPLICATION, but application can open documents.
BACKGROUND: Just migrated all my files and apps from a G4-400 to a new Mac Mini 1.87ghz Intel running pre-installed OSX10.4.10. Used CD to install 'normal' version of Office 2004 Mac on the new Mac Mini. In fact its the same disk that I used originally to install Office on the G4-400. PROBLEM: Neither old .xls and .doc documents (made on old Mac, nor new .xls and ..doc documents (made on new Mac)will not open their respective applications, when clicked upon. ADDITIONAL INFO: However, when I use either of the the application's "Open" feature, theres is no pr...

Opening .prn files in XL2000
I am using a software that does not save data/reports in .csv or .xls formats; only in printed versions. Is there a way to save the printed report in a file and open the file in XL2000? If there is, how is the print file produced, where is it saved, etc? A friend suggested setting up a generic printer but didn't know how to go about it. You may want to give that other software just one more chance--look under File and see if there is a SaveAs option. You may find something upon further review. But if you want to add a generic printer, I think it'll depend on your version of win...

Trying to open the current db in Access 2010 through Access Basic
I haven't programmed in Access Basic in quite a long time. Through Access Basic coding, I use to be able to open the current database and then open a table and walk through each record. Now I can't even open the database. Does anybody have an example of how to do the following: 1) Open Workspace 2) Open Current Database (assume name is unknown during run time 3) Open specific table 4) Step through each record and access the fields George C. Derkacs <George C. Derkacs@discussions.microsoft.com> wrote: >I haven't programmed in Access Basic in quite a lon...

MS Access 2007, Forms
When using the "Forms Wizard", I need to use the "Style: Ricepaper", but it isn't available in the 2007 version and I have not been successful trying to find it in Office Online or on the web. Does anyone know where I can get it? Access 2007 has 25 AutoFormats, but as you noticed, they are virtually all new ones. It's actually nice to see that these were updated. To get the older Ricepaper style you could probably create a form in an earlier version of Access and then import it into your current database. If you're using the ACCDB file format, you would...

Where can I get a good holiday booking form for my golf business?
I need a quality Booking Form for my Golf Holiday business on the Costa Del Sol. One which includes sections for accommodation, dates, numbers, flight enquiries and car hire enquiries. Any help would be much appreciated on a tight budget. Thanks Dave Wrong forum. Try templates or doing it yourself. :-) -- Russell Dawson Excel Student Please hit "Yes" if this post was helpful. "Dave" wrote: > I need a quality Booking Form for my Golf Holiday business on the Costa Del > Sol. > One which includes sections for accommodation, dates, numbe...

Compare each value in a range to each value in another range
I am looking for a macro that will return a comparison of each cell in a range to each cell in another range. example. the first range would have vales of 1,2,3 and the second range would have values of 5,6,7 Thus the macro should return 9 possible comparisons: 1 & 5, 1 & 6, 1 & 7, 2 & 5, 2 & 6, 2 & 7, 3 & 5, 3 & 6, 3 & 7, Can anybody help me with this?? Just hazarding some thoughts here .. Perhaps using formulas would suffice ? Example: Assume 1st range is A1:A3, 2nd range is B1:B3. Then Compare 1st range against 2nd range I...

Help
Hi... I tried to work on Word today for first time on newish Mac and realized none of my Office applications work. When I double click on Word I can see something happening as I get the circle of colours twirling, but half an hour later it still hadn't opened. I just have to do this as quickly as possible as I have a deadline for what I have to do Monday at 12. I've tried reinstalling the software, but that didn't do anything for me. Mind you I know absolutely nothing about installing anything on Mac computers so I could be doing it all wrong. Do any of you have any idea what c...

Giving Someone Access to Another Mailbox
I have a situation where one of our Admin Assistants is going to start sifting thru one of our executives email. What is the best way for this person to be able to see mailbox items? I would like to give this access via OWA only if possible and not neccessarily set it up on the client Outlook. Any help would be greatly appreciated. Which version of Exchange Server are you running? "mpallo" <mpallo@discussions.microsoft.com> wrote in message news:1CCFB8C2-E2EC-40B7-A5F2-27D37E856ABE@microsoft.com... >I have a situation where one of our Admin Assistants is going to st...

how2 create identity column on contact form
how to use identity contact_id column on sql contactbase table, because i want to, auto increment id field with contactid The ContactId field is defined as a uniqueidetifier (ie. GUID). When you create records via the SDK calls, this value will be assigned for you automatically. I would not recommend going directly against the tables to create records. "tashtan" <mehmettastan@gmx.net> wrote in message news:e44cBjtoDHA.2868@TK2MSFTNGP09.phx.gbl... how to use identity contact_id column on sql contactbase table, because i want to, auto increment id field with contactid ...

Different field control sources for unbound form
Hi. I'm using Access 97. The short description of my problem is: I have an unbound form named Stats1. On the form I have 3 text boxes (AvgofR1, AvgofR2, and AvgofR3). There are 3 "total queries" (Q1, Q2, and Q3) that when run return an average in a field called AvgofR1 for query 1, AvgofR2 for query 2, and AvgofR3 for query 3. How do I get the value of AvgofR1 from query Q1 to appear in the text box AvgofR1, the value of AvgofR2 from query Q2 to appear in the text box AvgofR2, and the value of AvgofR3 from query Q3 to appear in the text box AvgofR3 on the unbound form Stats1...