Search button

Rmaster

Rmaster
Local time
Today, 17:49
Joined
Mar 7, 2005
Messages
25
Hello

I need a button that looks at 2 text field in my form that must be the same as 2 field from my table, and display the information from it. I made an example for explain my problem.

In my example i've 1 table: Users
1 Form: frmZoek

In the form are 2 textboxes and 1 command button:
txt1 (Firstname)
txt2 (date)
Command16 (Search)

Now i want that if you fillin txt1 and txt2 the search button looks up in the table if there is a match, if there is one it dislpay all the information under it.

Sorry for my bad english.
 

Attachments

  • 1.zip
    1.zip
    23.3 KB · Views: 172
Have a look at "QuickSearch" in the samples. Its a good search Db and looks good. Just amend the code to use your own fields to search on.

Failing that, there are many search examples posted if you do a search

Col
 
thanks for the reply,

But i don't want that the users can see the information untill they typed the correct name and date. It's for secutity reasons.
 
I've been searching for the answer for this one also. I only want the results of the search to be available/displayed. Please let me know if you find a solution. Thanks.

Chris
 
ColinEssex said:
how will they know its correct?

It doesn't matter how they know it's correct, that is the secutiry of it sow the people can't guess what the correct information is, only the people who really know.
 
Last edited:
Why don't you just hit the users with a couple of InputBox's prior to opening the form?
You could then limit the form's recordset using the criteria provided. If it was wrong, you could give them a few tries and then kick them out.
 
Sergeant said:
Why don't you just hit the users with a couple of InputBox's prior to opening the form?
You could then limit the form's recordset using the criteria provided. If it was wrong, you could give them a few tries and then kick them out.


I want that users type the name and date because not everyone is allowed to see that information. Sow it's for secutiry.
 
Another idea would be to add a field to the Users table and enter the user's Windows UserName.
Then you could add that field to your form's query and in the criteria for the field, put...
=Environ("UserName")
Of course, this only works if the users run your app from their own login.
 
Sergeant said:
Another idea would be to add a field to the Users table and enter the user's Windows UserName.
Then you could add that field to your form's query and in the criteria for the field, put...
=Environ("UserName")
Of course, this only works if the users run your app from their own login.

u mean that only 1 user can see the information?
 
Yes, they would see their own record(s) only. You would be limiting that in the form's query.
 
they way i want it, is that more than only the "creator" of the record can see it. There must be a way thay you fillin the 2 textfields and that a code checks if ther's a match.

Thanks for your advise it could be usefull if nobody else knows a other way
 
Now i've
But there's no output

Code:
Private Sub Command16_Click()
If IsNull(txt1) Or IsNull(txt2) Then
MsgBox "Must fillin Firstname and Date", vbInformation, "Foutje"
Else
Me.RecordsetClone.FindFirst "[FirstName] = '" & Me![txt1].Value & "'And Date= #" & Me.txt2 & "#"
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom