Nice NeoPa , but I didn't get the point?
what's the relation between the code required for the button and what you said?
User Profile
Collapse
-
Nice NeoPa:
I post [Option Explicit] and finally it worked with me
I put this code to ensure the simplest level of comparison:
...Code:Option Explicit Private Sub searchButton_Click() Dim Inn As String Inn = InputBox("Would you enter the Employee's First Name?") If Inn = "amin" Then MsgBox ("OK") If Inn <> "amin" Then MsgBox ("Wrong Name")Leave a comment:
-
-
Neopa & ChipR :
4- I choose the lower case.
When I put my 5th line as Else statement without End If, it shows a compile error [Else without If], when I put ElseIf, it shows syntax error (without any other clarification) and shows [ElseIf] statement with red line.
Neopa : your code in participation #14 didn't work!! , I still click on the search button without any response or even error message....Leave a comment:
-
ADezii : Thanks, but your code doesn't work! (I don't know why?), I still clicking on the button after I paste the code ,...Code:Private Sub searchButton_Click() Dim Inn As String Inn = InputBox("Would you enter the Employee's First Name?") If Inn = txtFirstName Then MsgBox ("OK") End If If Inn <> txtFirstName Then MsgBox ("This name is not valid") End If End SubLeave a comment:
-
This is the code
when I tried to writeCode:Private Sub searchButton_Click() Dim Inn As String Inn = InputBox("Would you enter Employee's First Name?") MsgBox Inn End Sub
As try to make simple comparison, it shows to me an error message said (you have to put ElseIf and when I put it...Code:If Inn = txtFirstname Then MsgBox ("OK") Else MsgBox ("This name is not valid")Leave a comment:
-
1- The name of the query is DetailedInforma tion.
2- The name of the field is FirstName.
3- I don't want to put a text field: I just put a form button and name it (search) and right in it's code the when I click on it , it will give me an Input box then complete the process (the code is attached) , and after the comparison will done, I want another message box to show the results.
4- I don't worry about...Leave a comment:
-
NeoPa
Thanks for reply and you understood what I mean (sorry to not explain it). I want a form (which I named it : start : ) which contains a search button which will search by name in q query and then the result will come as a Message Box contains the information about the employee.
How can I use DLookup() method , I want to use it with DetailedInforma tion query. then if the input name is valid in the query:...Leave a comment:
-
Search Button Code?
Hi :
I would like to ask about : how can I write the (simplist) code for search button. I'm bignner in using Access 2007 & VBA . This button will search by name in a query which contains all employees informations then if the name is valid, message box will show and disply all the related informations for the employee....
No activity results to display
Show More
Leave a comment: