Forms :: Setting A Control To Enabled
Oct 25, 2013
I want a combo box to be enabled only when I want to edit the data in the cbo for that particular record or when the fo0rm is on a new record. So, by default the cbo is Enabled No and Locked Yes. I placed a button on the form and put the following in the On Click:
Code:
Private Sub cmdEditContactsType_Click()
Me!cboContactFilter.Enabled = True
Me!cboContactFilter.Locked = False
End Sub
But when I press the button the control remains disabled.The field has several Contact genres and since I'm using the data in a split form allowing edits to the single form side I don't want this cbo enabled during browsing.
View Replies
ADVERTISEMENT
Jul 7, 2014
I have an unbound form which has 2 unbound combo boxes on it, both based on the same table, but I have used a query for each one to created the sort order, one alphabetically by item name (cmbA) and the other numerically by the item number (cmbN) . I also have a text field (ID) upon which is based a report when the user clicks a button. Currently the text box (ID) has a control source of column 1 of cmbA and I have the report working perfectly if one selects from the name combo box (cmbA) What I want to do is allow the user to select from cmbN and have the control source of the ID text box equal the number the selected so the report button will work then also.
I have tried to set the control source after update of cmbN but all that does is blank out the ID text box. I have not done this before so I am sure I have done it incorrectly. I tried again this morning using me.ID.ControlSource = Me.cmbN and stepping through the code shows that the cmbN ControlSource is equal to ID but I can't make the code that follows use the results.
View 8 Replies
View Related
Jun 12, 2014
I have a combo box control in my form named PayDateID, but I told that control to DISPLAY the associated field PayDate.
I now am trying to make a separate control in the same form whose control source is the DISPLAYED PayDate, but it only wants to reference the underlying PayDateID.
How can I make the control source be the displayed value in that combo box?
View 1 Replies
View Related
Nov 4, 2013
I have an Access 2010 form within my database in which I have a series of 8 tabs on a tab control. I am the only user who will have access to these tabs. I want to require a password in order to permit access to the tabs. The very first tab on the tab control works as a cover tab. There is no relevant information for anyone to view...only a graphic.
How to code the "on change" event of the tab control.
View 1 Replies
View Related
Jun 7, 2006
I have encountered a strange side effect. I am enabling and disabling several controls (the cludgy way-one at a time) depending upon the presence or absence of data in a field, using the oncurrent event to decide. It works.
But! It also moves some controls. Most of the controls stay put. But all four datepicker controls move to the upper left corner of the form when the oncurrent encounters the conditions that make these controls enabled. When they are disabled, they show up in the right place. When I navigate from a record where they are disabled to a record with data where they should be enabled, they are enabled but moved. When I navigate to a new record and all fields are enabled, but in their proper places. Any suggestions? Here's the code (* are the offending datepicker controls):
If IsNull(Me.Billed) And IsNull(Me.Paid) Then
Me.Categories.Enabled = True
Me.Project.Enabled = True
Me.Who_Are_You.Enabled = True
Me.Start.Enabled = True *
Me.End.Enabled = True *
Me.Billed.Enabled = True *
Me.Details.Enabled = True
Me.Paid.Enabled = True *
Me.btn_Billed_Now.Enabled = True
Me.btn_End_Now.Enabled = True
Me.btn_Paid_Now.Enabled = True
Me.btn_Start_Now.Enabled = True
Me.Categories.Locked = False
Me.Project.Locked = False
Me.Who_Are_You.Locked = False
Me.Start.Locked = False
Me.End.Locked = False
Me.Billed.Locked = False
Me.Details.Locked = False
Me.Paid.Locked = False
ElseIf IsNull(Me.Paid) Then
Me.Categories.Enabled = False
Me.Project.Enabled = False
Me.Who_Are_You.Enabled = False
Me.Start.Enabled = False
Me.End.Enabled = False
Me.Billed.Enabled = False
Me.Details.Enabled = False
Me.Paid.Locked = False
'Me.Paid.Enabled = True
Me.btn_Billed_Now.Enabled = False
Me.btn_End_Now.Enabled = False
Me.btn_Paid_Now.Enabled = True
Me.btn_Start_Now.Enabled = False
Else
Me.Categories.Enabled = False
Me.Project.Enabled = False
Me.Who_Are_You.Enabled = False
Me.Start.Enabled = False
Me.End.Enabled = False
Me.Billed.Enabled = False
Me.Details.Enabled = False
Me.Paid.Enabled = False
Me.btn_Billed_Now.Enabled = False
Me.btn_End_Now.Enabled = False
Me.btn_Paid_Now.Enabled = False
Me.btn_Start_Now.Enabled = False
Me.Categories.Locked = True
Me.Project.Locked = True
Me.Who_Are_You.Locked = True
Me.Start.Locked = True
Me.End.Locked = True
Me.Billed.Locked = True
Me.Details.Locked = True
Me.Paid.Locked = True
View 1 Replies
View Related
Jun 24, 2013
When I right click a row on the data sheet side of a split form an select "New Record" I want the curser to go to the first field on the single record side. I've placed this in the OnCurrent but it did no good.
Code:
If Me.NewRecord Then
Me!Descrfiption.SetFocus.
End If
Any way to set the focus to the single form Side of a split form?
View 4 Replies
View Related
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
May 15, 2015
I am trying to set a value to a control in my subform (On Load) but it is not working.
FRM_ASQ has a button upon clicking open a FRM_Planchange_Input which has a subform FRM_PlanChange_Input_Details.
On Load - I assign values to controls in the FRM_Planchange_Input and I am trying to assign values to control in the subform FRM_PlanChange_Input_Details.
On Load,
SetPropery -
Control Name: [Forms]![FRM_Planchange_Input]![FRM_PlanChange_Input_Details].[Form]![ASQ]
Property: Value
Value: =[Forms]![FRM_ASQ]![ASQ #]
I am copying the data in Form ASQ to Subform Plan Change Details. Whenever the macro is run, it gets stuck at the point giving an error "The control name is misspelled or refers to a control that doesn't exist. If the invalid control name is in macro, an Action Failed dialog box will display the macro name and the macro's arguments after you click OK."
Upon clicking OK, i get Error Number 3021 - Arguments [Forms]![FRM_Planchange_Input]![FRM_PlanChange_Input_Details].[Form]![ASQ]
The syntax I used is based on this article: Forms![main form name]![subform control name].Form![control name]. I also read that Subform Control Name and Subform Name are not the same?
View 3 Replies
View Related
Aug 19, 2005
Ok, here is my question. I am just a little rusty since it has been a while since I have been in Access.
So I have a option group: option 1, option 2, option 3
If option 1 is selected I want textbox 1 visible, but textbox 2 and 3 not visible.
If option 2 is selected I want textbox 2 visible, but textbox 1 and 3 not visible.
If option 3 is selected I want textbox 3 visible, but textbox 1 and 2 not visible.
When the form first opens, all textboxes are not visible. What is the correct way to do this: code, macro, etc? and where should I place it? Should it be in the Afterupdate property of the option group?
Thanks!!
View 1 Replies
View Related
Oct 25, 2005
I have a very simple report - just one field.
I have a Form - "Cases". The button to open the report is on that form as are the values I want in the report.
I want to pull the value of Case Name and Case Number from the current form view and put them together in the single field on my report.
I can "almost" do it. Then VBA gives me a warning - it says that you can't assign a value to the control on my report.
Can anyone give me any ideas?
by the way:
I chose to make this an unbound report because I'm using SQL server as my back-end and my Access is an .adp file. SQL (so I was told by the programmers at work) can't pull in variable criteria from a form like Access Queries can. So this all has to be put in VBA.
View 5 Replies
View Related
Sep 24, 2013
Windows vista
access 2007
I'm populating a report with a query which pulls criteria from a form. When the 'run' button is pressed it opens the report, running the query, to filter the data. What i'm attempting (and it works if there is data present).
The data is text, which is a filename, which populates an image control. Most of my records have an image present but for the ones that don't I think I need to turn the image control's picture property to 'blank'.
I'm just now encountering problems with the records with no pictures so when i came up with this it worked with my tests which at that time only had images present....
I have two problems.
1) When I run the code as below i get Run-Time Error 2185; you can't reference a property or method for a control unless the control has the focus.
2) when i try to set the focus on the picture control in the report to see if there is text/value present i get runtime error 2478; database doesn't allow you to use this method in the current view.
I assume this is talking about me opening the report in acViewPreview mode but i thought i needed to do this so the images are displayed in the image control.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim strDBPath As String
Dim strRelativePath As String
Dim strPath As String
'rptOriginalOwnerCategoryItem!Picture.Text.SetFocus
[B]Me!Picture.SetFocus[B]
'Test to see if the record has a relative path stored
[code]....
View 4 Replies
View Related
May 17, 2014
I agree completely with everyone when it comes to not using lookup fields in tables.But does that extend to Display Control of yes/no tables? What are the problems with setting the Display Control to "Check Box"?
View 4 Replies
View Related
Nov 19, 2014
I am having an issue setting an instantiated forms' control. I am having RemDate ("Date") and RemTime ("Time") TextBox; so far the date textbox shows 1/1/1988 12:00 AM (the visible value is the time only) and the Time textbox doesn't show anything.
Code:
Set frm = New Form_ReminderAssigneesFrm
frm.RecordSource = "Select * from ReminderAssignees Where RemID = " & Parent.RemID
frm.RemID.DefaultValue = Parent.RemID
With SetRS(frm.RecordSource)
If Not .EOF Then
frm.RemDate.DefaultValue = FormatDateTime(.Fields("RemDate"), vbShortDate)
[Code] ....
View 2 Replies
View Related
May 5, 2014
I have a form that has five subforms on it. On Open all the subforms are unbound (so i can prevent the queries from running before the On Open event to speed up). Then i can enter my criteria for all five subforms in txtbox and click run. After I establish the source object for the subforms, i cannot establish the controlsource for several text boxes that pull the data from the subform, i get #Name?. her is a sample from the on click event... the top links the unbound subform and the bottom should then link a control in the subform to a control on the main form.
Me.Child167.SourceObject = "query.RP Sum Fuelman F1"
Me.Text71.ControlSource = "=[RP Sum Fuelman F1 Subform]![cntRecords]"
View 1 Replies
View Related
Oct 21, 2013
Is there a way to set the control source for an entire form through VBA? I have a database that was set up just as an archive file, not intending to have any forms or reports in it. It was simply to house tables containing data from previous years. My main database just copies the table over to the archive file and adds the year to the table name. I have just been told that the users would like a form and a series of reports set up in this database.
I would like to set the main form up so that before it will allow them to do anything, they have to enter the year of the data they are looking for. After the year has been entered, I would like to adjust the control source of the form to reflect the appropriate table. In other words, when a user opens the archived database, he or she will see a field for the year an nothing else. Once they enter the year they are looking for, the form will populate with data from the corresponding table (the table names look like this - tblPM_Completed_2013). Is this possible?
View 6 Replies
View Related
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
Sep 24, 2013
I added a new field to one of my tables and query, but when I try to add a control for that field into my form it is not recognising it and the field isn't appearing in the sources for the form, even though the table is sourced to the form? Or am I going to have to do the usual and redo the entire form because I made a minor adjustment?
View 1 Replies
View Related
Jun 18, 2014
I have a form with a tab control, inside the tab control I placed an ActiveX control (Microsoft Web Browser). These are at the bottom of the form.
Everything displays fine if the entire form fit on the screen but if the form is too long and I scroll down the browser control is getting obscured by the tab control and getting chopped off (the contents are covered). It is as if the browser control is staying in space where it was and moving behind the tab control as I scroll.
This problem does not occur if I place the browser control directly on the form. Also I note that the browser control is sitting correctly within the tab control.
I have been through all the settings and properties of both controls and haven't been able to fix it. I searched all over the web but no one has previously stumbled across this one by the look of it.
See the attached image ...
View 3 Replies
View Related
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
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
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
Jun 15, 2005
I have a form with many command buttons. This form is a master for a database that keeps time for my department. One command button is a setup button that I want the user to run once and only once. What code, and where do I put it will allow my to set the command button's visible or enabled to be false. Even when the user closed the database and reopend it, if the user has run the setup once, I do not want to allow them to run it again.
Thanks.
View 5 Replies
View Related
Jun 12, 2006
In a simple data retrieve/update form, how I can set a text field’s properties Enabled to No based on that particular record value?
For instance, there are 4 fields, employeeid, employeename, employeetitle, employeephone
I would like to set the employeephone text field’s properties Enabled = No, if the employeetitle is Manager
Can anyone help?
View 4 Replies
View Related
Oct 7, 2013
I have a form for creating a new database record for a list of "components".
One button "add_component" adds a new record.
One text input "component_input" allows you to enter in the "name" of the component.
One button "save_component" saves the record.
The component_input and save_component have their default "enabled" property set to "No" in their properties list.
I only want the component_input and save_component form objects to be enabled once the "add_component" button has been clicked. Once the "save_component" button is clicked, I want them to return to being disabled. This will prevent any accidental over-writing of records.
I have used "build event" for the "add_component" button...
Code:
if [macroError] <> 0 then
## errorMessage here ##
else
setProperty
control name: component_input
property: enabled
[Code] ....
And then I have used "build event" for the "save_component" button...
Code:
if [macroError] <> 0 then
## errorMessage here ##
else
setProperty
control name: component_input
[Code] ....
Now, this works when add_component is first clicked, however when I click save_component neither component_input or save_component become disabled again.
View 4 Replies
View Related
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 2 Replies
View Related
Feb 9, 2007
I presently have a form that I have all the fields set as read only by using the enabled and the locked property of each field. However I have to be able to open the form to certain users with all fields enabled and unlocked. I need code that will run through each field and set the field's enabled to True and the locked to false. This code I will apply to a button that will open the form.
Cheers
View 1 Replies
View Related