By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,573 Members | 938 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,573 IT Pros & Developers. It's quick & easy.

Disable Replace in Search and Replace Command Button

P: 22
I created a command button using the record navigation feature, find record. Does anyone know how to turn off the functionality of the "replace" tab that gives the user the ability to replace the data in a table? I would like to give the user the ability to search and recall a record with the search feature in order to locate a record for editing; however, I do not want them to have the ability to replace any data. Any information would be greatly appreciated. Thanks!!
Jul 17 '07 #1
Share this Question
Share on Google+
13 Replies


P: 22
Sorry but forgot to mention that I am placing this on a form and using the 2003 version. Thanks again.
Jul 18 '07 #2

nico5038
Expert 2.5K+
P: 3,072
In general I present the users a datasheet subform where they can use the right-click pop-up for filtering and selecting the row the need.
The datasheet can be made "read-only". Besides the datasheet I have the action buttons ADD, UPDATE and DELETE to allow the basic operation.

Gues that will fit your needs. Check for the right-click popup possibilities:
http://www.geocities.com/nico5038/xR...nstruction.zip
and for a datasheet sample:
http://www.geocities.com/nico5038/xS...tAction-97.zip

Nic;o)
Jul 18 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
I'm sorry, but this statement doesn't make sense!

"I would like to give the user the ability to search and recall a record with the search feature in order to locate a record for editing; however, I do not want them to have the ability to replace any data."

How do you edit a record without replacing any data?

Linq ;0)>
Jul 18 '07 #4

P: 22
Thanks for the feedback and information.

Sorry, it's hard communicating when you are typing sometimes. :)

What I am trying to achieve is the ability to search for a record in a table on the same form where the data is entered. Once the record is retrieved, then I would like for the user to change the data by accessing the fields on the form. I am afraid if they use the replace feature, then they may globally change many records simultaneously when they should be only be changing the fields of one record at a time. I hope that makes more sense.
Jul 19 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
Is the field you're searching on unique, i.e. is there only one record that will match the criteria?

Linq ;0)>
Jul 19 '07 #6

P: 22
What I would like for them to search for would be only one field and unique; however, the search and replace functionality appears to be pretty much open to all fields. From experimenting with it, whatever field you click on prior to pressing the search button is the area it filters for on the entire table. That's why I wanted to at least turn off the replace capability and force changes thru the fields on the form.
Jul 19 '07 #7

puppydogbuddy
Expert 100+
P: 1,923
What I would like for them to search for would be only one field and unique; however, the search and replace functionality appears to be pretty much open to all fields. From experimenting with it, whatever field you click on prior to pressing the search button is the area it filters for on the entire table. That's why I wanted to at least turn off the replace capability and force changes thru the fields on the form.
Pictures are worth a thousand words. See these links for HowTO's

Search form using a textbox as a search field
http://www.databasedev.co.uk/text_search.html

Search form using a listbox as the search field:
http://www.databasedev.co.uk/list_box_searching.html
Jul 19 '07 #8

P: 22
Thank you. I will check it out.
Jul 19 '07 #9

missinglinq
Expert 2.5K+
P: 3,532
I think pdb has the right idea; you need to utilize a custom search routine rather than using the native Find & Replace feature. I've seen a modification done on the feature in the past, but the problem, if I remember correctly, is that it involved using the SendKeys function, which is notoriously unstable!

Linq ;0)>
Jul 19 '07 #10

P: 22
Thanks for the info. I was wondering if this was a viable option. :)
Jul 19 '07 #11

ADezii
Expert 5K+
P: 8,632
Thanks for the info. I was wondering if this was a viable option. :)
I'm pretty sure that the native Find and Replace Dialog provided by Access cannot be modified in any manner, such as removing the Replace Tab. There were some very good alternatives listed which you should take a serious look at.
Jul 26 '07 #12

missinglinq
Expert 2.5K+
P: 3,532
The only way to disable the Replace feature is to make the form either read only or to set AllowEdits to False.
Jul 27 '07 #13

P: 1
Turn this:
_______ . _______
| Find . . .\ | Replace \
| . . . . . . . ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| . . . . . . . . . . . _______________
| .Find What: .| . . . . . . . . . . . . . . . |
| . . . . . . . . . . . ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

To this:
_______
| Find . . .\
| . . . . . . . ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
| . . . . . . . . . . . _______________
| .Find What: .| . . . . . . . . . . . . . . . |
| . . . . . . . . . . . ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

By turning this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSearch_Click()
  2. On Error GoTo Err_cmdSearch_Click
  3.  
  4.     Screen.PreviousControl.SetFocus
  5.     DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
  6.  
  7. Exit_cmdSearch_Click:
  8.     Exit Sub
  9.  
  10. Err_cmdSearch_Click:
  11.     MsgBox Err.Description
  12.     Resume Exit_cmdSearch_Click
  13.  
  14. End Sub
Into this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSearch_Click()
  2. On Error GoTo Err_cmdSearch_Click
  3.  
  4.     Screen.PreviousControl.SetFocus
  5.     Me.AllowEdits = False
  6.     DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
  7.     Me.AllowEdits = True
  8.  
  9. Exit_cmdSearch_Click:
  10.     Exit Sub
  11.  
  12. Err_cmdSearch_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_cmdSearch_Click
  15.  
  16. End Sub
Dec 9 '11 #14

Post your reply

Sign in to post your reply or Sign up for a free account.