If statement with Dlookup, plus open form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




I am trying to write a function that when someone enters a phone number in a
text box, it will look this phone number up in a table, then let me know if
the phone number is already in the table or if they have to add it. The
below formula isn't working the way I need it too. It tells me that every
phone number I type into the text box is not in the table. I know this is
wrong because I tried typing a phone number in the text box that I knew was
in the table, and it still came back as it wasn't. What is wrong with my
formula? Also, If the person clicks "yes" when it pops up saying "do you
want to add a new customer", I would like it to open up another form. How
can I do this?


If IsNull(DLookup("[BTN]", "Master Table", "[BTN]" = "" & Forms![Sales
Tracker1]![BTN])) Then MsgBox ("The phone number does not exist in your
Module")
If MsgBox("Do You Want to Add A New Customer?", vbQuestion + _
vbYesNo, "Phone Number Not Found") = vbYes Then
'Do whatever if you want to add a btn
Else
'Do whatever if you don't want to add it
End If

End Sub
.



Relevant Pages

  • RE: If statement with Dlookup, plus open form
    ... I copied this into my formula, but it still comes back as saying the phone ... >> want to add a new customer", I would like it to open up another form. ... >> End Sub ... Prev by Date: ...
    (microsoft.public.access.forms)
  • Re: Perl Getops
    ... > without any additional flags it will automatically show the help or a ... > title saying what it does. ... > sub get_options ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: THE CUSTOMER IS STILL ALWAYS RIGHT
    ... >I have always had a problem with that saying, ... >yourself who use it don't really mean it, but instead mean that the customer ... insight. ... Prev by Date: ...
    (alt.marketing.online.ebay)
  • RE: If statement with Dlookup, plus open form
    ... "Matt" wrote: ... > I copied this into my formula, but it still comes back as saying the phone ... >>> End Sub ... Prev by Date: ...
    (microsoft.public.access.forms)
  • If Null Error Message
    ... I have a text box with code that when the user enters a customer number, ... message pops up that they must also enter a company name if the company name ... Private Sub companynum_AfterUpdate ... Prev by Date: ...
    (microsoft.public.access.formscoding)