I Need To Change The Enabled Property After Changing Records

Nov 23, 2005

Hi Guys,

i have a problem i hope some one can help me with.

i have a form with a sub form on it, and i want to disable everything until the user clicks a 'edit' button to allow the information to be changed.

i am just testing it at the moment, so i set one text box's enabled property to false. then i added a button with an on click event with the following code:

Me!userid.Enabled = True

when i start the form, the userid box is disabled and when i click on the edit button, it enables it fine.

however, when i change to the next record, the userid box remains enabled. i cant find where to put the code to set it back to false everytime i change the record.

i should also let you know i am a beginner, so please be gentle!

View Replies


ADVERTISEMENT

Forms :: Change Button Enabled Status On Field Values

Jun 22, 2014

I have several buttons on a form and I want to set enabled = false on one of them when I open the form - that's fine

I have two txt fields - ReceiptNo and BankPaymtId if the both have a value I want to make the button enabled = True

This is the code I have used on the BankPaymentId On Dirty event

Private Sub BankPaymentId_Dirty(Cancel As Integer)
If Me.[ReceiptNo] <> "" Then
If Me.[BankPaymtId] <> "" Then
Me.CreateOutlay.Enabled = True
End If
End If
End Sub

This is the one for ReceiptNum on Dirty event

Private Sub ReceiptNum_Dirty(Cancel As Integer)
If Me.[ReceiptNo] <> "" Then
If Me.[BankPaymtId] <> "" Then
Me.CreateOutlay.Enabled = True
End If
End If
End Sub

Nothing seems to be happening.

Even the Form on Dirty is not working now....

View 4 Replies View Related

Forms :: Change To Forms Property Causes Fetching Different Records

May 5, 2013

I have a form that launches a query. The results are displayed in a continuous form called ParentForm. On the ParentForm is a combobox which selects a singleform called a ChildForm that displays the details of the selected record. I placed a command button on the ChildForm. This button simulates a circular triple state toggle switch. By clicking this switch the form goes from ReadOnly to Edit to Add modes. The form properties AllowEdits , Allow Additions and DataEntry are adjusted accordingly. These properties when they are changed seem to initiate requery of the underlying data source. Here is the code. I am looking for a way to avoid requery of the data when the mod is changed.

Code:
Private Sub ModeBt_Click()
'-------------------------------------------------------------------------------
' Circular toggle button to change display mode of the form
' ReadOnly - Edit - Add
'-------------------------------------------------------------------------------
Select Case Me.Mode
Case "Edit Mode"
Me.AllowEdits = False

[code]....

View 3 Replies View Related

Changing Property Settings By Code

Dec 2, 2006

This is getting into some stratospheric territory for me.

I am trying to change the visibility property of a label and corresponding text box, based on the contents of a different combo box. cboHow is a combo box that uses a value list as its row source, since the content of the list won't change. There are three fields that I need when the content of cboHow = "FIS". Otherwise I don't need them and I don't want to see them. My code is below:

Private Sub txtFISDepartmentNumber_BeforeUpdate(Cancel As Integer)
If cboHow <> "FIS" Then
lblFISDepartmentNumber.Visible = False
txtFISDepartmentNumber.Visible = False
Else: lblFISDepartmentNumber.Visible = True
txtFISDepartmentNumber.Visible = True
End Sub

At the moment there is no error code, but the label and text field don't respond by becoming visible/invisible when the contents of cboHow changes. Do I put this code with the txtFISDepartmentNumber or in cboHow? and do I use BeforeUpdate or AfterUpdate? Should I have a separate If..Then..Else for the label and the text box?

I have been playing around with this for several hours now and seem to be going in circles.

I am using A2K

View 7 Replies View Related

Modules & VBA :: Changing Table Property - After Update Check For Invalid Charters

Feb 1, 2014

I cant change the table property to number only so is there an afterupdate code I could run on a field and check for alphanumartic charters ?

View 1 Replies View Related

Reports :: Changing Visible Property Of Blank Image Fields In A Report

Dec 8, 2014

My student is doing a project on question paper generation in which he selects questions from each lesson needed and also some of these questions have images associated with them. So, if these questions are selected, the image control in the report displays it.

If there is no image, the space for the control is left in tact. I tried changing the visible property for the image control in the Detail_Format event procedure. But this code is not reached at all and the space is still left. I am not storing the image directly in the field but its path in a text field.

I want that the space occupied by the image control removed. I tried the suppression thing but obviously it did not work.

View 6 Replies View Related

How Do I Change Data In Property Mode

Nov 11, 2004

I have created a form in access 2000. I now want to change the table that this form uses. Normally I would just click the properties tab and then select data, a list of all tables would come up and I would choose the correct table. For some reason I cannot access the data tab. The other four tabs are all availabe, but not the data tab. It is like the data is locked or something. I have clicked on properties on my desktop icon and it is not locked. Please help.

Photoone

View 1 Replies View Related

2007 Upgrade - Change Subdatasheet Property??

May 30, 2007

We just upgraded to Office 2007 and are experiencing very slow access performance. This microsoft article addresses the problem:

http://support.microsoft.com/kb/275085

It won't let me change Subdatasheet Name property to [NONE].

Even if I am able to change it, will this affect my table links. I have a lot of them.

I am just the part-time Access "programmer" here and am somewhat lost trying to figure this out. Does anyone have a simple explanation and solution? I would appreciate any help so much!!

View 1 Replies View Related

Dynamically Change SourceDatabase Property Of A Query

Feb 7, 2008

Access 2003:

I have a query (qryGetRemoteStuff) like this:SELECT * FROM Table1 IN 'k:projectssomedatabase.mdb'I have several databases where i use this technique. I don't want to link these tables to my database.
According to the properties list, "Source Database" is used to store this path to my remote database.
So far so good.
When the path changes i am in a lot of trouble, that is why i want to change the path of this query dynamically. I don't seem able to change this property.

Is this possible? How?

Immediate window:
?currentdb.QueryDefs("qryGetRemoteStuff").Properties("SourceDatabase")Returns "Property not found". Access help F1 doesn't provide me with a workable example.

View 2 Replies View Related

General :: Can't Change Required Field Property

Jul 16, 2013

I am trying to change a field to be required. I know where it is...

(Navigation Pane > Design View > Select field I want required > Properties Pane > General Tab > set Required property to Yes)

But I don't see that General Tab at the bottom of my page.

The closest thing I have to properties is on the right-hand side. It opens when I right-click, then hit Properties. It displays...

Format | Data | Event | Other | All... but that's it...

[URL]

View 4 Replies View Related

Tables :: Change Table Field Property Programmatically

Apr 23, 2014

I am using Access 2010. How to change the property of a field in a table programmatically.

I have a table in which one field has Required property set to "Yes". I would like to set this property by using VBA code to "No", then add data into a table using a query and re-set the Required property to "Yes".

Is this possible and if so, how can I do it?

View 6 Replies View Related

Forms :: Property Selection Change - Event Procedure?

Aug 16, 2013

when the Form Property "selectionchange" kicks in?I am trying to use this to run an event procedure. I have a sub form datasheet which contains a date, and when the selection is changed from one record to another in the sub form, I would like to run an event procedure that updates certain fields on the main form, according to the date.I have put msgbox in the event procedure, but it doesn't trigger when the selection is changed? or am I misunderstanding the property?I have also tried got focus, lostfocus, beforeupdate, but they only trigger when the record is changed, not just when the selection is changed.

View 4 Replies View Related

Modules & VBA :: Change Default View Property Of Subform

Feb 26, 2014

I have a form with a subform where I want to select (via button) which format to open the form in. Opening the form is simple, DoCmd.OpenForm (FormName),acFormDS to open in datasheet, however, the subform opens in default view (single form). Can you programmatically set the property on the subform to change the Default View from Single Form to Datasheet and back?

View 3 Replies View Related

Reports :: Change Specific Subreport Visible Property Base Of A Select

May 6, 2015

I have stumbled across an issue in my report involving the Report.SourceObject property. The section of the report contains a subreport that needs to change dynamically to display the report that relates to the corresponding test. When trying to change the subreports.Sourceobject property I get the error Run-time error 2191: You cant set the Source Object Property in the print preview or after printing has started.This is very clear to me what the limitation is, however I was wondering if there was some way around this.

I have currently tried creating multiple subreports that are stacked on each other with visible property set to false. Then I change the specific subreport visible property base of a select. This worked, but was extremely hard on the machine and printer as there is about 15 different possible subreports.

Secondly I have tried exporting it to RTF and just manually copying and pasting the tables. The down side with this is all the formatting and work I have put into the report as a whole goes out the window so if possible would like to avoid this situation as well.

View 8 Replies View Related

Modules & VBA :: Changing Image Path - Set Picture Property Of Image

Dec 4, 2014

I have a form that I would like to update a picture on using VBA. The source of the picture path is in part a query that is not bound to the form. So far I have the following code that is pretty much working, but with a couple flaws.

Code:
Private Sub Form_Current()
LoadDefaultPicture
End Sub
Sub LoadDefaultPicture()
Dim db As DAO.Database

[Code] ....

This is working. However, when I change the record the picture flashes the current picture once and then loads the new picture. It is like it reloads the current picture then loads the new one. I'm hoping there is a way to get rid of the flash.

Also, the code fails here:
strDefaultPictureName = rs.Fields("AttachmentName")

When the query does not return a record. I can definitely fix this by adding an if statement to check for a record, but I'm kind of perplexed at why it is failing at that line. I would expect it to assign an empty string to that variable name and then fail on the next command where I try and set the ".Picture" property of the image.

View 8 Replies View Related

How Do I Change An Image (Ole Object) In A Form When Changing Value Of A Combo Box?

Mar 14, 2007

My Db has 1 table with 4 columns named ID, First_name, Last_name and Photo.

ID is a counter and primary key.
First+last names are text fields.
Photo is an Ole object.

I display everything in a form that is controlled by a combo box. The combo box displays the first name and when I chage the first name with this box the last name changes too. I use this code together with the event "after update"

Code:Private Sub Combo_First_name_AfterUpdate()Me.txt_last_name.Value = Me.Combo_first_name.Column(2)

Everything works perfectly fine (txt_last_name changes according to the first name in the combo box), except that the photo of the person doesn't change. Nothing happens to the photo when changing value in the combo box or it just displays a message box with an error messages when I have tried to get it to work.

I want the ole object picture to change too, when changing the first name in the combo box.

I hope you can help me out here.

View 4 Replies View Related

Tables :: How To Change Values Within Calculated Column Without Changing Expression

Jul 31, 2014

Currently I have a calculated field in my table; however, under certain circumstances I need to change the value to another value which is not related to the calculation. I understand that the calculated fields are read only (why is that?), so I was wondering if there was any way to change values within a calculated column without actually changing the expression itself.

View 1 Replies View Related

Using SetValue To Change Field Property Based On Another Field Value

Dec 15, 2006

I would like to change the property of a text box to Visible and Required when a user chooses a specific value in a drop down box of a different text box. Is this possible using a macro or some other way?

Thank you,
Deana

View 1 Replies View Related

On Load Property VB Code To Limit Records In Main File.

May 3, 2005

I have an Access application for which I would like to provide potential customers with a fully functional application but with a limit to the number of records that can be stored in the main file.

I would like to have a message displayed to say "The maximum number of records have been reached for this application."

Could you help with the VB code required to do this? The module will become active at the "On Open" property when the main Form is opened.

Thank you.

Regards,

Clive Shakespeare

View 2 Replies View Related

Enabled - No

Aug 14, 2007

HI
Does anyone know a way to stop the text box going grey when you un enable it?

View 3 Replies View Related

Changing Records

Dec 21, 2004

Hi, I'm in the process of making a super simple database (3 - tables). I have run into a problem with two of the tables. The relationship between them is one -> many. Say, I have a record in the (one) table which contains a primary key that is also part of a compound primary key in the (many) table.

Ex:

tblEx1 - (1 side of relationship)
red(pk)
blue
yellow
etc...

tblEx2 - (many side of relationship)
red(pk)
purple(pk)
orange
etc...

If I create a record in tblEx1 and type in some BS for the "red(pk)" field, and I then go to tblEx2, fill in all the fields, and also type in the same BS for the
"red(pk)" field, and come back at a later date, and want to change the value of the "red(pk)" field in both those tables for a certain record, it will not allow me. It doesn't matter which one I go to first. Would I have to delete the relationship everytime to be able to change the value for the "red(pk)" field in either table?

On a related question. In the above example when your doing data entry I'm not sure if I'm doing this right. It seems odd to me that I would have to type in the field for "red(pk)" in both tables, isn't their a way it can automatically figure out to put the same value from the first table into the next one since thier in a relationship.

Sorry if the above is confusing, and stupid. I'm just asking cause I did a whole bunch of records and I have to modify the name of the field which is the primary key, and I don't want to have to delete all the records and re-enter them; that would be a big time waster. Any help is appreciated.

View 3 Replies View Related

Tick Box Doesn't Appear Enabled.

Jun 23, 2005

Have a number of tick boxes on different forms. When the form is opened the tick box appears to be greyed out however it is enabled. Is there any way that these tick boxes can appear enabled???

View 2 Replies View Related

Required Field If Enabled.

Aug 7, 2006

After some suggestions, I have a form with combo boxes, the combo boxes are set to enabled "no", but become enabled by an after update command on another field.

The after update command works perfectly, however once enabled I need to ensure data is selected, as opposed to leaving blank.

Any ideas on the best/easiest way?

View 14 Replies View Related

Check Box = Visible/Enabled

Jun 16, 2005

Hi,

I am having a mare trying to do something which I think should be quite simple, as follows.

In a table I have the field [Entitled]. On my form I have this as a yes/no check box.

I have the following code in the VB.

Private Sub Check112_AfterUpdate()
If Me![Check112] = True Then
Me![Entitled].Visible = True
(or I could use) Me![Entitled].Enabled = True
Else
Me![Entitled].Visible = False
(or I could use) Me![Entitled].Enabled = False
End If
End Sub

Some people have the field checked and others do not.

The problem is; when I check or uncheck the box on individual records shown on the form, the value is remebered when I scroll to the next record (i.e. the box may be unchecked but the field is still visible/enabled). It is doing my head in! Help Please.

Mac

View 3 Replies View Related

Changing Order Of Records

Feb 10, 2006

I am making a database that requires a list of all the crew people in our company. This list is not sorted by alphabetical order but by order of significance (or frequency of) crew person. This list is rather lengthy and if I add a crew person it can only be added to the bottom of the list. The only way I have been able to do this is by manually resorting and retyping the list. Is there any way to add a row in the middle of a table (like I can in Excel)??

Thanks, Joe

View 7 Replies View Related

Changing Records Through Queries

Aug 19, 2005

Whenever I have a form that is based on a query, I am not able to edit the data in the form. Is there any way to change that? I have all allowances set to yes and Data Entry also set to yes. The form contains data for a single record.

View 3 Replies View Related







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