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
>