AllowDeletions/Edits - Other alternatives

aucho22

Registered User.
Local time
Yesterday, 23:05
Joined
Jul 4, 2014
Messages
32
Hello fellows,

I have a form that allows users to add items to a table -of employee roles - (later used as drop down list).

I turned off AllowDeletions and AllowEdits, so they were only able to add new records to the list. But let's say, they enter a new item in the list "Forklift Driverrr" and realize later on that they made a spelling mistake, they cannot change the record as the option is turned off.

I tried playing around with AllowDeletions/AllowEdits without luck. So I thought maybe what I need is a code that, when command is pressed, would ask for a password to be able to change the record and only one person would be able to do it knowing the consequences...? But it seems a bit of complicated for something so simple...

Do you guys have any idea how to deal with this issue?

I am only a starter in Access and VBA, but have a fair understanding of forms/reports/relationships/joint tables.

Thanks for your help,
Aucho
 
One way would be to use syntax such as this on your field:
SomeField = StrConv(SomeField, vbProperCase)
Alternatively you could set permissions for the form per use:
Or if you want to go the password route place a command button on the form and use something like this, of course modify to suit your needs.
Cancel = (InputBox("Password?") <> "password")
Me.AllowEdits = True


HTH
 
Hello burrina,

Thanks for the tips,

I believe vbProperCase would work only to change uppercases & lowercases,

Password code is great, although as before if users decide to replace one of the line with another role instead of using a new line, all the related records in the table will change (Aucho Project Manager will become Aucho Forklift Driver...)

But this is a good start and will try and look what I can do with these :)

Thank you for your help,
Aucho
 
Alternatively you could run a spell check.
Dim ctlSpell As Control

' Check the spelling in the selected text box
Me.desc.SetFocus

Set ctlSpell = Screen.PreviousControl
If TypeOf ctlSpell Is TextBox Then
If IsNull(Len(ctlSpell)) Or Len(ctlSpell) = 0 Then
MsgBox "Spell Check is Complete."
ctlSpell.SetFocus
Exit Sub
End If
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
Else
MsgBox "Spell check is complete."
End If

ctlSpell.SetFocus

Good Luck!
 
Thank you Burrina, I will try this as soon as I can!
 

Users who are viewing this thread

Back
Top Bottom