Disable Edit In Text Box

Dec 11, 2005

I would like to disable editing in a text box once the information has been entered initially, but would like to be able to turn editing back on by double clicking the text box label. This is to be used for a database I'm creating for truck fleet management. Any ideas??

View Replies


ADVERTISEMENT

Disable Input Controls Until Edit/update

Jul 27, 2006

Hi all,

I have a form that displays fields from two tables. I have set the properties of Allow Edit, Allow Additions, Allow Update, Data Entry to NO. However I want to allow users to be able to add new, edit/update and delete records from the form by clicking on respective command buttons.

the problem is that the code that I am using is giving me errors that says that I "You cannot go to the specified field" I need help on proper VB code to use that will allow me to enable input and update on the records in the table.

Private Sub cmdAdd_Click()

Me.Location_ID.Locked = False
Me.Location_Parent.Locked = False
Me.Zone.Locked = False
Me.Description.Locked = False
Me.Child12.Locked = False

DoCmd.GoToRecord , , acNewRec

End Sub

Dont know if that makes any sense, but I want to add a new record and i get errors

Neeeeeed some help ASAP....

View 5 Replies View Related

Forms :: Gray-out / Disable Text Fields By Checking A Text Box

Nov 21, 2013

how can i disable a textfield or two in a form when the textbox is unchecked also how do i add a default value for it while the textbox itself is disabled, can i get away with it by adding a default value on the textbox?

View 14 Replies View Related

Modules & VBA :: Disable And Clear Text Box?

May 23, 2015

using Ms access 2010.I have two text boxes where depending on what is entered on the first the 2nd disabled.that works fine but if I make a mistake and enters a value on the 2nd while it is enabled and return back to the first and enters a value which disable the 2nd, it disable it ok but keeps the value and even save it to the table.

Private Sub q300_AfterUpdate()
If Me.q300 = "1" Then
Me.q300_1.Text = ""
Me.q300_1.Enabled = False
Me.q301.SetFocus
Else
Me.q300_1.Enabled = True
End If
End Sub

View 9 Replies View Related

Modules & VBA :: How To Edit A Publisher Text Box

Jun 25, 2014

I'm currently using the following to edit a publisher document using access VBA.

Code:
For Each pubShape In pubDoc.Pages(1).Shapes
If pubShape.HasTextFrame Then
If pubShape.Name = "Text Box 440" Then pubShape.TextFrame.TextRange.Text = Item1
If pubShape.Name = "Text Box 441" Then pubShape.TextFrame.TextRange.Text = Item2
If pubShape.Name = "Text Box 442" Then pubShape.TextFrame.TextRange.Text = Item3
If pubShape.Name = "Text Box 443" Then pubShape.TextFrame.TextRange.Text = Item4
If pubShape.Name = "Text Box 444" Then pubShape.TextFrame.TextRange.Text = Item5
If pubShape.Name = "Text Box 445" Then pubShape.TextFrame.TextRange.Text = Item6
If pubShape.Name = "Text Box 446" Then pubShape.TextFrame.TextRange.Text = Item7
If pubShape.Name = "Text Box 447" Then pubShape.TextFrame.TextRange.Text = Item8
End If
Next

Obviously there are a lot of shapes/boxes etc in the document and this code is very inefficient and takes a few moments to complete. Is there a way to directly reference a text box and change its value. For word I have been using bookmarks but this doesn't seem to work with publisher.

I'm looking for something like pubshape.Value("text Box 440") = Item1 but cannot find the correct syntax.

View 2 Replies View Related

Data Disappearing From Unbound Text Boxes Upon Edit.

Jan 12, 2006

Hello,

I have a form that utilizes a combo box called cboProgAddr (for Program Address). The cbox has 5 columns each of which fills in an adjacent text box. Since I needed the option of making corrections to these text boxes once they were filled in I need to set them up as unbound via the following code in the After Update event of cboProgAddr:

Private Sub cboProgAddr_AfterUpdate()
Me!txtProgStreet.Value = Me!cboProgAddr.Column(1)
Me!txtLocStreet.Value = Me!cboProgAddr.Column(1)
Me!txtProgCitySt.Value = Me!cboProgAddr.Column(2)
Me!txtLocCitySt.Value = Me!cboProgAddr.Column(2)
Me!txtProgZip.Value = Me!cboProgAddr.Column(3)
Me!txtLocZip.Value = Me!cboProgAddr.Column(3)
End Sub

As you can see it puts each field of data into two separate text boxes. Here's the issue: If I have to go back to the form after the original data entry the following boxes are blank...

txtProgStreet
txtProgCitySt
txtProgZip

while the following retain the orginal data...

txtLocStreet
txtLocCitySt
txtLocProgZip

The original cboProgAddr maintains its original data. All six fields above are stored in the same table as text field. I'd like all the boxes to maintain the data from the original input.

I'm totally baffled why this is so. I've attached images of the combo box control functions if that helps.


Thanks,
David

View 1 Replies View Related

Modules & VBA :: Disable Button When Text / Combo Fields Are Null

Aug 5, 2013

On a form, I want to disable the save button, 'cmdSave' whilst the form's mandatory fields have been left blank.

I've put in a smart tag, called, 'Req' against each required field and have used the following code on the forms current event.

Code:
Private Sub Form_Current()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Or ctl.ControlType = acListBox Then

[Code] ....

The save button is disabled, but it won't enable again after each field has data entered against it.

I also have this code in the AfterUpdate event in each required field:

Code:
Private Sub cboErrorID_AfterUpdate()
Call Form_Current
End Sub

View 13 Replies View Related

Disable Min / Max

Sep 8, 2006

Hi

I know how to disable the min / max buttons on a form, but can anybody provide help with disabling the Min / Max buttons of the access application itself, I recently found some code that somebody had posted to disable the "X" button, now I would like to disable the min / max function as well.

Many thanks

Plug

View 3 Replies View Related

Disable Shift Key, F11 Etc..

Oct 31, 2005

Hi,

I am just about to set up user level security for my database. Before I do, how do I disable the holding the shift key thing when opening a database to get into the database window?

I want to make it so the users can't see the database window or access the backend data. As I will need to give permissions to use most of the tables, how is this done?

I am using Version: 2002 (10.0) XP

Any help would be much appreciated.

Thanks

View 1 Replies View Related

Disable The [Shift] Key

Apr 26, 2007

I need to disable the [Shift] key so that when the users open my MS Access database, they cannot by pass the open form and display the database window.

We had code that worked correctly with an MS Access 2000 MDB, and even works with an MS Access 2003 ADP, but the same code is ignored by MS Access 2003 MDB.

We add Module named "DisableByPassKey", here is the code...

Public Function SetProperties(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
On Error GoTo Err_SetProperties

Dim prps As AccessObjectProperties
Dim prp As AccessObjectProperty
Dim isPresent As Boolean


Set prps = Application.CurrentProject.Properties
For Each prp In prps
If (StrComp(prp.Name, strPropName, vbTextCompare) = 0) Then
isPresent = True
Exit For
End If
Next

If (isPresent) Then
prps(strPropName).Value = varPropValue
Else
prps.Add strPropName, varPropValue
End If

Exit_SetProperties:
Exit Function

Err_SetProperties:
If Err = 3270 Then 'Property not found
Properties.Append prp
Resume Next
Else
SetProperties = False
MsgBox "Runtime Error # " & Err.Number & vbCrLf & vbLf & Err.Description
Resume Exit_SetProperties
End If

End Function

The code does not cause an error, it just seems to do nothing. When I set the [Shift] key to "disabled", then re-open the database, the [Shift] key works once again.

If you have any ideas, it would be great.

Thank you!

View 2 Replies View Related

Disable Spaces

Dec 7, 2007

Hi, I have a text box in a from for data entry, how do I disable a space. For example I don't want the user to have a space between charaters or before and after a charater. Thanks.

View 7 Replies View Related

Disable Problem

Jan 19, 2008

The code to disable shift keys at start up that has been posted here numeroous times is causing me problems. I am a complete novice with vba. but i cannot seem to get it to work and there seems to be a problem with the following line of code:-

db.Properties(strPropName) = varPropValue

Can anyone explain what may be going wrong. The shift key still by-passes and no password is asked for. If I do click the button on the start-up screen and enter the password I get error 3270 and the line above is highlighted.

View 3 Replies View Related

Yes/no Enable Disable

May 23, 2005

Here is my problem: When a certain yes/no box is true (checked) other fields on the form are not enabled. That works just find when I am on the record that I click the yes/no field. When I go to another record and then go back to the previous record the fields that should be disabled due to a certain yes/no box being true are now enabled and not disabled. Below is my code. Can anyone tell me what I am doing wrong?

Private Sub Form_Current()

SetCheckBoxes

End Sub

Private Sub SetCheckBoxes()

If Me.StaPrimary = True Then
Me.StaUp.Enabled = False
Me.StaUpTrainerFirstName.Enabled = False
Me.StaUpTrainerLastName.Enabled = False
Me.StaUpVerifyDate.Enabled = False
Me.StaUpReverifyDate.Enabled = False
Me.StaBack.Enabled = False
Me.StaBackTrainerFirstName.Enabled = False
Me.StaBackTrainerLastName.Enabled = False
Me.StaBackVerifyDate.Enabled = False
Me.StaBackReverifyDate.Enabled = False
Me.StaOther.Enabled = False
Me.StaOtherTrainerFirstName.Enabled = False
Me.StaOtherTrainerLastName.Enabled = False
Me.StaOtherVerifyDate.Enabled = False
Me.StaOtherReverifyDate.Enabled = False
End If

If Me.StaPrimary = False Then
Me.StaUp.Enabled = True
Me.StaUpTrainerFirstName.Enabled = True
Me.StaUpTrainerLastName.Enabled = True
Me.StaUpVerifyDate.Enabled = True
Me.StaUpReverifyDate.Enabled = True
Me.StaBack.Enabled = True
Me.StaBackTrainerFirstName.Enabled = True
Me.StaBackTrainerLastName.Enabled = True
Me.StaBackVerifyDate.Enabled = True
Me.StaBackReverifyDate.Enabled = True
Me.StaOther.Enabled = True
Me.StaOtherTrainerFirstName.Enabled = True
Me.StaOtherTrainerLastName.Enabled = True
Me.StaOtherVerifyDate.Enabled = True
Me.StaOtherReverifyDate.Enabled = True
Me.StaPrimaryVerifyDate = ""
Me.StaPrimaryReVerifyDate = ""

End If

If Me.StaUp = True Then
Me.StaPrimary.Enabled = False
Me.StaPrimaryTrainerFirstName.Enabled = False
Me.StaPrimaryTrainerLastName.Enabled = False
Me.StaPrimaryVerifyDate.Enabled = False
Me.StaPrimaryReVerifyDate.Enabled = False
Me.StaBack.Enabled = False
Me.StaBackTrainerFirstName.Enabled = False
Me.StaBackTrainerLastName.Enabled = False
Me.StaBackVerifyDate.Enabled = False
Me.StaBackReverifyDate.Enabled = False
Me.StaOther.Enabled = False
Me.StaOtherTrainerFirstName.Enabled = False
Me.StaOtherTrainerLastName.Enabled = False
Me.StaOtherVerifyDate.Enabled = False
Me.StaOtherReverifyDate.Enabled = False
End If

If Me.StaUp = False Then
Me.StaPrimary.Enabled = True
Me.StaPrimaryTrainerFirstName.Enabled = True
Me.StaPrimaryTrainerLastName.Enabled = True
Me.StaPrimaryVerifyDate.Enabled = True
Me.StaPrimaryReVerifyDate.Enabled = True
Me.StaBack.Enabled = True
Me.StaBackTrainerFirstName.Enabled = True
Me.StaBackTrainerLastName.Enabled = True
Me.StaBackVerifyDate.Enabled = True
Me.StaBackReverifyDate.Enabled = True
Me.StaOther.Enabled = True
Me.StaOtherTrainerFirstName.Enabled = True
Me.StaOtherTrainerLastName.Enabled = True
Me.StaOtherVerifyDate.Enabled = True
Me.StaOtherReverifyDate.Enabled = True
Me.StaUpVerifyDate = ""
Me.StaUpReverifyDate = ""

End If

If Me.StaBack = True Then
Me.StaPrimary.Enabled = False
Me.StaPrimaryTrainerFirstName.Enabled = False
Me.StaPrimaryTrainerLastName.Enabled = False
Me.StaPrimaryVerifyDate.Enabled = False
Me.StaPrimaryReVerifyDate.Enabled = False
Me.StaUp.Enabled = False
Me.StaUpTrainerFirstName.Enabled = False
Me.StaUpTrainerLastName.Enabled = False
Me.StaUpVerifyDate.Enabled = False
Me.StaUpReverifyDate.Enabled = False
Me.StaOther.Enabled = False
Me.StaOtherTrainerFirstName.Enabled = False
Me.StaOtherTrainerLastName.Enabled = False
Me.StaOtherVerifyDate.Enabled = False
Me.StaOtherReverifyDate.Enabled = False
End If

If Me.StaBack = False Then
Me.StaPrimary.Enabled = True
Me.StaPrimaryTrainerFirstName.Enabled = True
Me.StaPrimaryTrainerLastName.Enabled = True
Me.StaPrimaryVerifyDate.Enabled = True
Me.StaPrimaryReVerifyDate.Enabled = True
Me.StaUp.Enabled = True
Me.StaUpTrainerFirstName.Enabled = True
Me.StaUpTrainerLastName.Enabled = True
Me.StaUpVerifyDate.Enabled = True
Me.StaUpReverifyDate.Enabled = True
Me.StaOther.Enabled = True
Me.StaOtherTrainerFirstName.Enabled = True
Me.StaOtherTrainerLastName.Enabled = True
Me.StaOtherVerifyDate.Enabled = True
Me.StaOtherReverifyDate.Enabled = True
Me.StaBackVerifyDate = ""
Me.StaBackReverifyDate = ""

End If

If Me.StaOther = True Then
Me.StaPrimary.Enabled = False
Me.StaPrimaryTrainerFirstName.Enabled = False
Me.StaPrimaryTrainerLastName.Enabled = False
Me.StaPrimaryVerifyDate.Enabled = False
Me.StaPrimaryReVerifyDate.Enabled = False
Me.StaUp.Enabled = False
Me.StaUpTrainerFirstName.Enabled = False
Me.StaUpTrainerLastName.Enabled = False
Me.StaUpVerifyDate.Enabled = False
Me.StaUpReverifyDate.Enabled = False
Me.StaBack.Enabled = False
Me.StaBackTrainerFirstName.Enabled = False
Me.StaBackTrainerLastName.Enabled = False
Me.StaBackVerifyDate.Enabled = False
Me.StaBackReverifyDate.Enabled = False
End If

If Me.StaOther = False Then
Me.StaPrimary.Enabled = True
Me.StaPrimaryTrainerFirstName.Enabled = True
Me.StaPrimaryTrainerLastName.Enabled = True
Me.StaPrimaryVerifyDate.Enabled = True
Me.StaPrimaryReVerifyDate.Enabled = True
Me.StaUp.Enabled = True
Me.StaUpTrainerFirstName.Enabled = True
Me.StaUpTrainerLastName.Enabled = True
Me.StaUpVerifyDate.Enabled = True
Me.StaUpReverifyDate.Enabled = True
Me.StaBack.Enabled = True
Me.StaBackTrainerFirstName.Enabled = True
Me.StaBackTrainerLastName.Enabled = True
Me.StaBackVerifyDate.Enabled = True
Me.StaBackReverifyDate.Enabled = True
Me.StaOtherVerifyDate = ""
Me.StaOtherReverifyDate = ""

End If

End Sub

View 8 Replies View Related

Disable Button

Jun 30, 2005

I am not sure but this how it should work in VB, I am trying to disable a button that exists on a different form:

ACAudio!Command89.Enabled = False

Where ACAudio is the name of the form and Command89 is the name of the button but I keep getting an error saying object required.

View 4 Replies View Related

Disable Right Click

Nov 30, 2005

Hi, Im currently creating a database for an A-Level project.
I am required to create a database for a real company.
They have asked me to stop the right click function on forms.
I have disabled almost every feature on the forms, however i cannot find a way to disable right click.
Please help.

Pete

View 4 Replies View Related

Disable Button

Jan 21, 2006

I want to disable the button "cmdNew" unless certain criteria are met. Here is the code that runs in Form_Current :

Private Sub Form_Current()

Me.cmdNext.Enabled = (Me.RecordsetClone.RecordCount > Me.CurrentRecord)
Me.cmdPrevious.Enabled = Me.CurrentRecord > 1
Me.cmdLast.Enabled = (Me.RecordsetClone.RecordCount > Me.CurrentRecord)
Me.cmdFirst.Enabled = Me.CurrentRecord > 1

If (Me.cboStatus.Value = "Approved" Or Me.cboStatus.Value = "Approved as Noted" Or IsNull(Me.cboStatus) Or Me.RecordsetClone.RecordCount > Me.CurrentRecord) Then
Me.cmdNew.Enabled = False
Else
Me.cmdNew.Enabled = True
End If

End Sub

The navigation buttons work flawlessly but the cmdNew button still is enabled when it shouldn't be. THe idea is that is will be disabled if:

-current record is not the last record
-cbostatus is blank(null)
-cbostatus is "approved"
-cbostatus is "approved as noted"

The only code that seems to work is the "me.recordsetclone.recordcount > Me.currentrecord" .

Am I going about this the wrong way? How can I check what is in the cbostatus box and have the cmdnew button enabled/disabled based on its value.

Thank you

View 12 Replies View Related

Disable Menus

Jan 30, 2006

I have the following code in the on_load of all of my forms to disable all menus:Dim i As IntegerFor i = 1 To CommandBars.CountCommandBars(i).Enabled = FalseNext iThe problem is that when I open a report in preview mode I cannot close, print, etc.Two questions:1. Is the above approach the best way to disable all menus and toolbars?2. How do I add a custom toolbar (already created) to the report preview only. I've tried doing in in the properties and by me.toolbar = "custom toolbar." Neither approach works. I suspect that the code I've used to disable the menus is keeping me from adding custom menus where I want them?I should also mention that I have also turned off all of the menus, toolbars, etc. in the options/startup.Thanks for your help!

View 2 Replies View Related

Disable VDU Output

Sep 9, 2006

Hi Everyone

Does anyone know how to disable the vdu output to the screen when loading multiple forms etc.

I have an annoying flicker when my main form is reloading.

Thanks in advance for any help,

Kindest regards

Tony

View 1 Replies View Related

Disable Check Box If!!

Feb 8, 2005

I have a combo box "cboSelectEvent" and a check box "ckPartRepl"

what i want is that if "cboSelectEvent" is like "X120*" then "ckPartRepl" would be disabled.

how should i write this and on which event action should i add this?

i think it should be on the lost focus or afterupdate but not sure.

should this work? i have tried it but the box always appears to be usable
Code:if me.cboSelectEvent = "X120*" thenme.ckPartRepl.enabled = falseelseme.ckPartRepl.enabled = trueend if



cheers

Andy

View 1 Replies View Related

'Enter Key Disable????

Mar 9, 2005

I have one form where I want the 'Enter key to be disabled. What is the best way to disable the 'Enter key for this one form without disable'n it for the entire database?

View 1 Replies View Related

Why Can't I Edit My Table?

Aug 5, 2007

I had Access '97 and was able to edit my table and make changes, etc.

I upgraded to Access 2000 and now I cannot edit my table and make changes, etc. The table is not locked.

Why?:confused:

View 1 Replies View Related

Why Can't I Edit Tables At All?

May 8, 2006

I'm accessing an iSeries database with MS Access and Client Access ODBC driver. This works fine for reports and such, but not for editing or updating.

Trying to use edit queries, I get error 3073 (..must use an updatable query). But if I just open a table in Access and don't use a query, you should be able to edit directly into the table. But for me, this isn't possible.:confused:

What could be the problem?

View 2 Replies View Related

Cannot Edit In Subform

May 9, 2006

Hi all, I have a search form that pulls data from a query. The data is displayed in a subform. I would like the user to be able to edit the data from the subform. I have set all the allow properties to yes and it still doesn't work. Does this problem have anything to do with relationships.

Thanks to all, this forum has been a great help for me.

View 6 Replies View Related

Can't Edit Form

Sep 8, 2006

I have a form called contractors. It works exactly like I want it but it won't let me edit it. The form is based on a query. I have checked the query as stated to do on some areas of this forum and I am able to change it by typing something in a field and it also updates the form for me but I can't edit the form directly. I have allow edits, allow deletions, allow additions set to yes and I have no locks on it. Any ideas?

I have also checked help in access on this to no avail. I am attaching the database so somebody can hopefully help me.

Tracy

View 6 Replies View Related

Edit Macros

Oct 4, 2004

I've got a project where an existing access db is being converted for use on a web site.

Our problem is that several of the macros apparently reference an 'S:' drive.

Is there any way I can edit these macros to change / remove the drive reference?

View 1 Replies View Related

Combo Box - Edit

Jan 26, 2006

A few years ago a consultant created a database for my company and trained one person on how to use it. Unfortunately, this person shortly left and the system was never used! I would like to get the system up and running, however I am a complete novice with Access and although I have figured out the basics I am having trouble with the one form that we use to enter data. Two of the drop-down or combo boxes must be completed by the person entering data in order for the record to be saved. How do we turn off this mandatory setting for each combo box? Or how do we add an option to the combo box that at least says N/A if the data enterer does not have the information on hand?

this is driving me crazy!!!

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved