Major search task

P

PaleRider

Hi,

I have a protected database and a guest group with read-only access to
forms, tables, ect. I want to them to be able to read data, but not change
anything. So far this works.

Now, I would like the guest group to be able to search on the last name
field and bring up the matching record without overwriting any data. Since
they only have read permissions, they can't type into or select anything from
the form controls. Is it possible to set up a search mechanism under these
circumstances? If so, what are the steps to make this possible.

PR
 
B

Beetle

Why not place an unbound text box in the header of the form
where they could type a name to use as a search parameter?
This would have no effect on your data.
 
P

PaleRider

Beetle, Albert,

I figured the easiest route would be the unbound text box. Instead, I have
an unbound combo box that uses a query. What I want to happen is when a user
finds the name they want and presses enter, have that entire record come up.

So far, when I find the name I want and press enter a record appears that
does not match my selection. How to fix that?

Here's my query:

SELECT qryPersonnel.Last_Name FROM qryPersonnel;

Here's the table the query uses:

(tblMain)
Main_ID
First_Name
Last_Name
Address
City
State
Zip
 
P

PaleRider

Beetle, Albert,

Sorry getting back so late. I ended up adding an unbound combo box that
uses FindFirst and Bookmark to retrieve the user selected record. It works
even when the guest group has limited read-only permissions. Also, I had to
overcome a problem with comma delimited names such as "Brown, Charlie" and
"Smith, Joe". A trick that John W. Vinson came up with solved that major
hurdle. John said something about FindFirst requiring stuff in an SQL
format, and then he did something will all those quotes and what not but it
worked.

Thank you both for your input on this and at least giving me a place to
start with how to solve this scenario. I've had you both answer other posts
of mine and I'm certain you could have achieved a solution for me. Having the
unbound combo box keeps my data from being destroyed. Thanks guys for that
tidbit. Someone else made some contributions with code below, but I can't
remember who and I apologize for that.

The final code to make it work is below. None of the code following is my
doing and thank god for that otherwise it probably wouldn't work at all:


Private Sub cboSearch_AfterUpdate()
Dim rst As DAO.Recordset
Dim myStr As String

myStr = "[Full_Name] LIKE """ & Me!cboSearch.Column(1) & "*"""

Set rst = Me.RecordsetClone
rst.FindFirst myStr
If rst.NoMatch Then
MsgBox "No entry found.", vbInformation
Else
Me.Bookmark = rst.Bookmark
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top