G
Guest
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
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