Setting A Control Property Based On A Selection

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 Replies


ADVERTISEMENT

Forms :: Invalid Control Property - Control Source

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

Setting Property To Yes/no Using Alter Table

Dec 4, 2004

I want to add a column to an existing table using the sql statement Alter table. The new column needs to be a yes/no type. The following code almost works but it only sets the column to a general logical type not specifically the yes/no check box .

DoCmd.RunSQL "Alter Table TblIssues Add [" & Issue & "] logical;"

Any ideas?

View 4 Replies View Related

Modules & VBA :: Setting Subdata Sheetname Property?

Aug 14, 2013

I am opening a query from a docmd.openquery action in a button... however, I would like to set the name of a sub query in VBA so that I can have one "main" query open with different sub queries. My main query is a "member roster" with basic person information, and the sub queries (linked on the person's id number) contain various other types of information.I have three different variations on the sub query, and I would like to reuse the main query and just change the sub query in code. This doesn't work.

Code:
Private Sub cmdMembershipRoster_Click()
DoCmd.Openquery "Rpt_MemberRoster", , subdatasheetname = "rpt_MemberHistory"

View 3 Replies View Related

Screwed Up Relationships , The LinkMasterFields Property Setting Has Produced This Er

Aug 16, 2007

I dont' know what happend but now when i tried to add something to one of my subforms i get this error
The LinkMasterFields property setting has produced this error:'The object doesn't contain the Automation object'Claims Header."
i had it working not sure when it got screwed up.
i'm freaking out. i have to get this working correctly.

EDIT:
just to make sure it's ok to do this.
my subform is running from a table that has my uid from my main form claim_id and i have it linked from those fields.
currently the claim_id i'm looking to add to isn't in the table that my subform runs off of.

View 3 Replies View Related

Modules & VBA :: Setting Filter Property Via On Open Event Of A Report

Dec 15, 2014

I have a report, on a control tab, on a main form.

On the form are two buttons: one to show all items, and one to filter them based on a boolean field called showitem.

The buttons work with the code below.

What I want to do but cannot seem to figure out is to have the report default to no filter.

The bound query has no criteria.

I'm trying to set the filter property via the on open or on load event and even if I isolate the report, cannot seem to reach it.

Code:
Private Sub b_hide_items_Click()
Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem <> 1"
Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = True
Me.Profile_Timeline_wNotes_subreport.Requery
End Sub

Private Sub b_show_all_Click()
Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem = 0"
Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = False
Me.Profile_Timeline_wNotes_subreport.Requery
End Sub

View 14 Replies View Related

Modules & VBA :: Setting OnClick Property Causes Immediate Launch Of Event Procedure

Feb 5, 2014

I tried to dynamically set image OnClick property to function with couple of attributes. Everything works well, but... it launches the function automatically without any mouse click! What is causing this? I want to execute the function only on the result of mouse click.

Piece of code:

Forms!Form1.Controls("Image" & i).OnClick = fclick(PiltID)

Private Function fclick(u)
DoCmd.OpenForm "Form2"
Forms!Form2.Image0.Picture = u
End Function

View 6 Replies View Related

ERR: The Expression AfterUpdate You Entered As Event Property Setting Produce Error!

Jan 11, 2005

ERR: The expression AfterUpdate you entered as event property setting produce the following error: Return without GoSub....

can someone help me...why..b'coz b4 this i'm using the same coding but it can work for another several form....

View 3 Replies View Related

Forms :: Expression On Click - Event Property Setting Produces Error

Nov 24, 2014

Code:

The expression On Click you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name

Now this is the error message that I am constantly getting from any command button I hit on a certain form. Here is the code of the form.

Option Compare Database
Option Explicit
Public inputCSV As String, ORG As String

Private Sub CopyToTableBt_Click()
Debug.Print "Sub Execute calling ImportCSVForConfederation inputCSV="; inputCSV; " ORG="; ORG
ImportCSVForConfederation Me.CSVs, ORG

[Code] ....

I changed the names of the buttons, reconstructed the code under those names, went to the modules and changed names, made sure that a sub o function name is not duplicated in the project... But helas the error is still there. It used to work and suddenly does not work.

View 2 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

Textbox's Control Source Property

Feb 15, 2006

I have a main form with about six text boxs, these are too small to display the complete data so I created a form with a larger text box. When I dbbl-click in any of the various text boxs on the main form it would open the new popup form displaying the data. I need to be able to access the control source property of the popup form's textbox to change the control source to match the selected text box on the main form. This would allow me to use only one popup form instead of six.

The code I use to access the actual popup form itself is:

Forms![Notes].Form.Caption = " Notes "

Now I need to know what the code is to access the forms textbox control source data.

Hope I have explained this correctly

View 3 Replies View Related

Forms :: WHERE In A Control Source Property Of Button

Mar 5, 2015

Is it possible to use WHERE in the Control Source property of a button on a form?

Something like this

= [Station Status]![Done] WHERE [station Status]![ID] = "28"

View 6 Replies View Related

General :: Control Source In Property Sheet

Aug 3, 2012

My question is in Access 2010 I am currently in the property sheet at a combo list i just added to a form to be more precise with the data the user will look for. My question is I know I have to be in Control source in order for the combo box to select the data that I entered from the table. When i click the arrow the drop list is empty and then when I click the elipses (three dots) it takes me into expression builder, so i am confused on what I should do to select the field I want the combo box to focus on.

View 2 Replies View Related

Modules & VBA :: Assign Value To Enumerated Control Property

Sep 13, 2014

I want to retrieve and assign values of a control's properties by naming the properties. So for example:

Dim myHeight As Long
Dim myPropertName As String
myPropertyName="Height"
myHeight = 315
Forms!Myform.MyTextBox.Height = myHeight

I can retrieve the value using Eval:

Debug.Print Eval("Forms!MyForm.MyTextBox." & myPropertyName ) gives 315

How can I do the inverse operation, ie.assign the value of a property whose name I have in a string MyPropertyName? I mean other than a brute-force approach with a huge Case.

View 3 Replies View Related

Replace Parameter Values In Control Source Property

Apr 28, 2007

I have a text box in a report, with it's control source property set to =[BegDt].
Upon loading the report a message box pops up and asks the user for the value of [begDt]. This occurs 3 more times for 3 other parameters.

Now I want to change the design of the report so I decided to put these 4 parameters on a form so the user can fill in the 4 values all at once rather than responding to 4 message boxes that pop up when you run the report.

The problem is now the control source properties in all the different text boxes need to be changed to [forms]![frmABC]![txtBegDt] etc.etc. There are over 100 text boxes in this report that make reference to the 4 different parameters.
Is there a replace command I can use to change all the occurrences in the text boxes or perhaps a simpler way would be to pass the values to the report through code.

I tried placing this in the report header's format event and it doesn't seem to have any effect.

Code:Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)begytd = [Forms]![frmABC]![txtStDt]endytd = [Forms]![frmABC]![txtEndDt]curmo = [Forms]![frmABC]![cboMo]curyr = [Forms]![frmABC]![cboYr]End Sub

I should mention that the report uses a table (tblRecap) as it's record source. I tried using a query that refers back to the form for the parameter values but that means I have to use the query as the reports record source and that creates a problem because the report needs fields from the table to perform calculations.

Can someone help me with a solution please.

Thanks for your time.

View 2 Replies View Related

Forms :: Full Info For All Property Options Of Any Form Control

Jun 26, 2015

How to set all controls in the form I would like to get complete information about all property options.

View 6 Replies View Related

Tables :: Numeric Field In A Table - Setting Field Property?

Nov 16, 2013

I have a numeric field (long integer) in a table. I've set the format to fixed. No matter what I set the decimal places to, auto, 0 or 2, when I enter a value of 0.71, it displays as 1.00

In my form, I've also set the field property to fixed, but it displays the value as 1.

View 2 Replies View Related

Modules & VBA :: Default Property For Control Bounded To Date / Time Field

Dec 4, 2013

Access 2007

In a table I have 2 fields:

D1 , Date/Time , DefaultValue: Date()
D2 , Date/Time , DefaultValue: Date()+1

In a form (bounded to this table) I have, of course, 2 controls bounded to this fields:

txtD1 and txtD2

If the user change the value in txtD1 (using the Date picker) I like to change the DefaultValue for txtD1 to the new date and the DefaultValue for txtD2 to the new date + 1 day. Something like this:

Code:
Private Sub txtD1_AfterUpdate()
Me.txtD1.DefaultValue = Me.txtD1
Me.txtD2.DefaultValue = Me.txtD1 + 1 day
End Sub

I tried whatever crossed my mind... with the same "result" : #Name?

My Regional settings:

Short date format: dd.MM.yyyy
Date separator: Dot
Simple: 05.12.2013

View 14 Replies View Related

Forms :: Use Formula In Caption Property For Page In Tab Control (Access 2007)

Oct 7, 2013

Is it possible to use a formula in the Caption property of a page in a tab control (i.e. to make it dynamic)

I have a number of tabs each with their own subform (with each subform driven by its own unique query)

I'd like the tab name to include the number of records returned by that query (so as records are added, the tab name is automatically updated with the new number)

So something along the lines of :

Page 1 (" & DCount("[ID]","[qryQuery1]") & ")"

Such that the page name appears as :

Page 1 (7)

I know I can code this programmatically but then that code has to be triggered by some event and I need the counts to be as real-time as feasibly possible rather than requiring the user to click on a control to trigger it. I was hoping by using a formula directly in the Caption property of the page, it would be dynamically updated every time a new record was added without the need to trigger an event first.

View 2 Replies View Related

Setting A Value To A Control In Subform

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

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 3 Replies View Related

Unbound Report - Setting Control Values

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

Modules & VBA :: Setting Focus On A Control In Report?

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

Forms :: Setting Control Source Of Text Box

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

Tables :: Setting Display Control To Check Box

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

Forms :: Setting Control Source To Combo Box

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







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