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!!
Disable Replace in Search and Replace Command Button
Collapse
X
-
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:
Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!
and for a datasheet sample:
Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!
Nic;o)Comment
-
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)>Comment
-
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.Comment
-
Is the field you're searching on unique, i.e. is there only one record that will match the criteria?
Linq ;0)>Comment
-
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.Comment
-
Originally posted by Ciara9What 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.
Search form using a textbox as a search field
Search form using a listbox as the search field:
Comment
-
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)>Comment
-
Originally posted by Ciara9Thanks for the info. I was wondering if this was a viable option. :)Comment
-
The only way to disable the Replace feature is to make the form either read only or to set AllowEdits to False.Comment
-
Turn this:
_______ . _______
| Find . . .\ | Replace \
| . . . . . . . ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯
| . . . . . . . . . . . _______________
| .Find What: .| . . . . . . . . . . . . . . . |
| . . . . . . . . . . . ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
To this:
_______
| Find . . .\
| . . . . . . . ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯
| . . . . . . . . . . . _______________
| .Find What: .| . . . . . . . . . . . . . . . |
| . . . . . . . . . . . ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
By turning this:
Code:Private Sub cmdSearch_Click() On Error GoTo Err_cmdSearch_Click Screen.PreviousControl.SetFocus DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 Exit_cmdSearch_Click: Exit Sub Err_cmdSearch_Click: MsgBox Err.Description Resume Exit_cmdSearch_Click End Sub
Code:Private Sub cmdSearch_Click() On Error GoTo Err_cmdSearch_Click Screen.PreviousControl.SetFocus [U][B]Me.AllowEdits = False[/B][/U] DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 [U][B]Me.AllowEdits = True[/B][/U] Exit_cmdSearch_Click: Exit Sub Err_cmdSearch_Click: MsgBox Err.Description Resume Exit_cmdSearch_Click End Sub
Comment
Comment