PC Review


Reply
Thread Tools Rate Thread

Search button to populate information

 
 
yomi m via AccessMonster.com
Guest
Posts: n/a
 
      28th Jul 2005

Okay i seriously need some quick help. I have an unbound text box
(txtContact) that phone number are entered into. When i hit the command
button (cmdSearch) i want to open a new form (Search Numbers), and have the
fields name and organization combo boxes to reflect the data based on
thephone number. i have a query that is based off a main table. i want the
search command button to read the query, find the phone number, and input a
name and org into the designated fields assigned to the number. I have been
trying to figure this out for weeks, what will the code be behind the search
button?


--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RlN0MQ==?=
Guest
Posts: n/a
 
      28th Jul 2005
hi,
you could use DLookup.

Me.txtname = DLookup("[name]", "yourtabel", "[PhoneNum] = '" &
[Forms]![yourfirstform]![txtphonenum] & "'")

note: this wrapped. should be one line

I've used this technique many time to populate a form. you would need a
DLookup of each text box you want to populate.

regards
FSt1
"yomi m via AccessMonster.com" wrote:

>
> Okay i seriously need some quick help. I have an unbound text box
> (txtContact) that phone number are entered into. When i hit the command
> button (cmdSearch) i want to open a new form (Search Numbers), and have the
> fields name and organization combo boxes to reflect the data based on
> thephone number. i have a query that is based off a main table. i want the
> search command button to read the query, find the phone number, and input a
> name and org into the designated fields assigned to the number. I have been
> trying to figure this out for weeks, what will the code be behind the search
> button?
>
>
> --
> Message posted via http://www.accessmonster.com
>

 
Reply With Quote
 
 
 
 
yomi m via AccessMonster.com
Guest
Posts: n/a
 
      28th Jul 2005

okay where do i put the d lookup statement. I want the form to look up
(Contact Number) on a query called (Customer Info), and send (Contact Name)
and (Organization) found into the (cmbName) and (cmb Organization) text boxes.


FSt1 wrote:
>hi,
>you could use DLookup.
>
>Me.txtname = DLookup("[name]", "yourtabel", "[PhoneNum] = '" &
>[Forms]![yourfirstform]![txtphonenum] & "'")
>
>note: this wrapped. should be one line
>
>I've used this technique many time to populate a form. you would need a
>DLookup of each text box you want to populate.
>
>regards
>FSt1
>
>> Okay i seriously need some quick help. I have an unbound text box
>> (txtContact) that phone number are entered into. When i hit the command

>[quoted text clipped - 5 lines]
>> trying to figure this out for weeks, what will the code be behind the search
>> button?



--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
=?Utf-8?B?RlN0MQ==?=
Guest
Posts: n/a
 
      28th Jul 2005
hi,
if you use DLookup, the form will not lookup anything in the query. DLookup
goes streight to the table to get the info. that is why you need a DLookup
statement for each data bit you want.
Form what you just posted, you will need 2 DLookup Statements. 1 for contact
Name and 1 for organization.

Me.cmbname = DLookup("[Contact name]", "yourTable", "[contact] = '" &
[Forms]![yourform]![txtcontact] & "'")

I adjusted the Dlookup statement a little but you will still have to plug in
some correct names.
the statement read something like this...
return field1 from record in table1 where field2 matched textbox1
also lookup to Dlookup in access help

you could put both in the contact text box's afterupdate event or somewere
in the cmdSearch button code.

Regards

FSt1

"yomi m via AccessMonster.com" wrote:

>
> okay where do i put the d lookup statement. I want the form to look up
> (Contact Number) on a query called (Customer Info), and send (Contact Name)
> and (Organization) found into the (cmbName) and (cmb Organization) text boxes.
>
>
> FSt1 wrote:
> >hi,
> >you could use DLookup.
> >
> >Me.txtname = DLookup("[name]", "yourtabel", "[PhoneNum] = '" &
> >[Forms]![yourfirstform]![txtphonenum] & "'")
> >
> >note: this wrapped. should be one line
> >
> >I've used this technique many time to populate a form. you would need a
> >DLookup of each text box you want to populate.
> >
> >regards
> >FSt1
> >
> >> Okay i seriously need some quick help. I have an unbound text box
> >> (txtContact) that phone number are entered into. When i hit the command

> >[quoted text clipped - 5 lines]
> >> trying to figure this out for weeks, what will the code be behind the search
> >> button?

>
>
> --
> Message posted via http://www.accessmonster.com
>

 
Reply With Quote
 
yomi m via AccessMonster.com
Guest
Posts: n/a
 
      28th Jul 2005

thanks, i'll try that to see what happens

FSt1 wrote:
>hi,
>if you use DLookup, the form will not lookup anything in the query. DLookup
>goes streight to the table to get the info. that is why you need a DLookup
>statement for each data bit you want.
>Form what you just posted, you will need 2 DLookup Statements. 1 for contact
>Name and 1 for organization.
>
>Me.cmbname = DLookup("[Contact name]", "yourTable", "[contact] = '" &
>[Forms]![yourform]![txtcontact] & "'")
>
>I adjusted the Dlookup statement a little but you will still have to plug in
>some correct names.
>the statement read something like this...
>return field1 from record in table1 where field2 matched textbox1
>also lookup to Dlookup in access help
>
>you could put both in the contact text box's afterupdate event or somewere
>in the cmdSearch button code.
>
>Regards
>
>FSt1
>
>> okay where do i put the d lookup statement. I want the form to look up
>> (Contact Number) on a query called (Customer Info), and send (Contact Name)

>[quoted text clipped - 19 lines]
>> >> trying to figure this out for weeks, what will the code be behind the search
>> >> button?



--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
yomi m via AccessMonster.com
Guest
Posts: n/a
 
      28th Jul 2005

what is "[contact] . Do i replace with muyown input?

FSt1 wrote:
>hi,
>if you use DLookup, the form will not lookup anything in the query. DLookup
>goes streight to the table to get the info. that is why you need a DLookup
>statement for each data bit you want.
>Form what you just posted, you will need 2 DLookup Statements. 1 for contact
>Name and 1 for organization.
>
>Me.cmbname = DLookup("[Contact name]", "yourTable", "[contact] = '" &
>[Forms]![yourform]![txtcontact] & "'")
>
>I adjusted the Dlookup statement a little but you will still have to plug in
>some correct names.
>the statement read something like this...
>return field1 from record in table1 where field2 matched textbox1
>also lookup to Dlookup in access help
>
>you could put both in the contact text box's afterupdate event or somewere
>in the cmdSearch button code.
>
>Regards
>
>FSt1
>
>> okay where do i put the d lookup statement. I want the form to look up
>> (Contact Number) on a query called (Customer Info), and send (Contact Name)

>[quoted text clipped - 19 lines]
>> >> trying to figure this out for weeks, what will the code be behind the search
>> >> button?



--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
search button to populate cells from sheet Rachel Microsoft Excel Programming 4 15th Nov 2009 09:33 AM
adding button like encryption and signing information button Ramazan Microsoft Outlook Program Addins 2 7th Oct 2008 01:57 PM
Add a search button to pull text with in a spreadsheet like this forums search button jiminy_crime Microsoft Excel Discussion 1 16th Jul 2004 08:32 AM
Win Explorer "Search" button on tool bar launches web search instead of Search Assistant T Pagano Microsoft Windows 2000 0 22nd Jan 2004 12:53 AM
Windows Explorer "Search" button on tool bar launches web search instead of Search Assistant T Pagano Microsoft Windows 2000 New Users 0 22nd Jan 2004 12:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:42 AM.