Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 27th, 2007, 03:41 PM
Authorized User
 
Join Date: Apr 2007
Location: Fort Bliss, Texas, USA.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default Contact Insertion Issue

Ok, I'm having an issue trying to insert a contacts' last name, first name and phone number into the parent form.

If you were able to open the db, when double-clicking on "frmTask", at the bottom there is a Listbox called "Pick-Up Contact" / List87 respectively. When you double-click on that list box, it'll open the form, "frmSearchContact". Here a user can search for a contact name and phone number to call when the task is completed and ready for pick-up by the originating organization. THIS WORKS FINE, even returns the results and all.

What I'm trying to do is when the user searches for someone, like if you type in "T", it'll pull up a contact name, when the user finds the person needed, they then will double-click on it in the list box on that form, "frmSearchContact", this will then input the LastName, FirstName, Phone of that particular contact into the listbox on the parent form, "frmTask".

That's what I can't figure out.

Thanks for the help,

B

Reply With Quote
  #2 (permalink)  
Old May 30th, 2007, 06:56 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is what you do.

Create a query that gets the first name, last name and contact info you want, then create a continuous form to display it. Then in the criteria field of the last name field in the query, put this:

Like [Please enter the first few letters of the contact's last name"] & "*"

Then create a button on the main form that says "Search for Contact by Last Name" that opens the continuous form. When this is clicked, the parameter prompt will fire from the query, and that will pop up asking for the first few letters of the contact's last name.

In the coninuous form, put a button in the detail section (when the form is run there will be a button for each record) that says "Use this Contact information" or something like that.

Then on the On Click event of the button on the continous form, put something like this:

Public sFirst, sLast, sPhone, sContact As String

sFirst = Me.FirstName
sLast = Me.LastName
sPhone = Me.Phone

sContact = sLast & ", " & sFirst & ": " & sPhone

[Forms]![frmYourOtherForm].[Contact] = sContact

DoCmd.Close

This will post the contact info to the originating form (which should still be open) and close the continuous form.

Did that work?



mmcdonal
Reply With Quote
  #3 (permalink)  
Old May 30th, 2007, 09:17 AM
Authorized User
 
Join Date: Apr 2007
Location: Fort Bliss, Texas, USA.
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it to work! Had to make the "ContactID" field show on the main form, then set the 'double-click' event on the list box to open the search contact form. Ran a query for the list box to search using the data entered into a text box. Then set the double-click property of the list box on the search page to push / pass the information (ContactID [pk]) back to the main form's ContactID field. Then the property of the list box was set to a query to pull the first name, last name and phone of that contact ID back into the field.

Works like a charm!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contact Form and Gmail Jamessaep BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 April 16th, 2008 07:58 AM
Add Contact nileshpatel Classic ASP Components 0 March 10th, 2007 01:50 AM
Contact Selectot in InfoPath anandhienator Infopath 0 February 19th, 2007 05:07 AM
Contact Form myself Classic ASP Basics 1 November 18th, 2006 11:16 AM
PHP contact form probe4 PHP How-To 1 September 14th, 2005 12:52 PM



All times are GMT -4. The time now is 01:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.