Forms :: Setting Properties In A Subform

Mar 9, 2015

I am trying to get the properties of enabled and locked set in a continuious subform depending on a yes/no field in each record. I have tried using the answer in thread 160062, but this only works when it is not a subform (unless I have done something stupid!)If the main form is frmMain and the continuious subform is frmSub, where am I going wrong with this code which is in the subforms Class Objects?

Private Sub Form_Current() If Me.MaterialIssue = True Then CRMSignOffDate.Enabled = True
CRMSignOffBy.Enabled = True CRMSignOffDate.Locked = False
CRMSignOffBy.Locked = False Else CRMSignOffDate.Enabled = False
CRMSignOffBy.Enabled = False CRMSignOffDate.Locked = True
CRMSignOffBy.Locked = True End IfEnd Submany.

View Replies


ADVERTISEMENT

Forms :: Setting Button OnClick Properties To A Function

Feb 3, 2015

I am try to open a form from another and set a button's OnClick properties to a function and I keep getting an error message..Run-Time Error 2450Cannot find the referenced form ..And this is the code I am using.

Case 113
DoCmd.OpenForm "frm_View_Defects_On_Screen", acNormal
Forms!frm_View_Defects_On_Screen.RecordSource = "qry_1st_Adv_Report_Combination_111"
Forms!frm_View_Defects_On_Screen.btn_Back_to_repor ts.OnClick = JumpBackToAdvancedReport()

I just don't want to create another form just for one button.

View 3 Replies View Related

Forms :: Setting Form Properties From Another Form Gives Nothing?

Aug 23, 2013

So I have two forms: Af and Bf

In Af, when a button, Abtn, clicked, it'll run

Code:
Me.Visible = False
DoCmd.OpenForm "Bf", , , , acFormEdit
Forms![Bf].Form!Blabel.Caption = Me.Atxtbox
Forms![Bf].Form!Bcombox = Me.Atxtbox

Then Af lost from view and Bf appears in form view, with Blabel and Bcombox show the value of Atxtbox.

BUT if I try something like this in Bf when an event happens

Code:
Me.Bcombox2.RowSource = "SELECT xx FROM tablexx WHERE yy = '" & Nz(Me.Bcombox) & "'"

Nothing will be shown in Bcombox2, because Me.Bcombox return Null. I know this from doing

Code:
MsgBox Me.Bcombox

and the message box will shows nothing. The same thing also happen with the Blabel's caption. In form view, it shows Atxtbox value, but when I accessed its caption's value, it returns Null.

What I wanna do is:

1) Open Af, insert value to Atxtbox

2) clicked Abtn, pass the value of Atxtbox to Bcombox

3) Af is closed, and Bf is opened

Why the null...?

View 5 Replies View Related

Setting Form Properties...

Jul 6, 2006

I have a form that is intended to be used for both data entry and to edit/delete records.

The form properties are set to:
AllowFilters = YES
AllowEdits = YES
AllowAdditions = YES
AllowDeletions = NO
DataEntry = YES

When a user opens the form from a menu they are given the choice for NEW, EDIT or DELETE.

If the user chooses NEW, the properties remain as above

If the user chooses EDIT or DELETE the form should open to a specific record as chosen on an interim form.

I have been using the following code to open the form for EDIT:
stLinkCriteria = "[fldID] = " & Forms!frmsearchresults.fldID
DoCmd.OpenForm "frmJobInfo", acNormal, , stLinkCriteria, , acFormEdit

However, the form continues to open in Data Entry mode.

I have a public variable that is set to NEW, EDIT or DELETE that can be used to trigger code...

Where should the form properties be set to make sure that the form opens correctly?

Any help would be appreciated.

Thanks!

View 1 Replies View Related

Setting Text Field Properties

Nov 11, 2006

Hi All,

I have only been playing with MS Access for a little while and I do not know all there is to know yet so I figured I come here to ask a question.

I use MS Access in web design and lately I have been experiencing a problem with my registration form which inserts new users into an MS Access database table.

Lately my registration form has become a target for spammers trying to inject spam in the form of html code into the password field of the online registration form.

I figured that I could deter this from happening by only allowing the letters A - Z and numbers 0 - 9 in the field and not allowing characters like < > and ? and ".

I assume I can do this with a validation rule but I'm unsure as to how I would go about setting this up. Limiting the field size to only 50 characters does not seem to work unfortunately.

Any help on how to set up a validation rule would be appreciated.

Thanks
Mechaworx

View 3 Replies View Related

Forms :: Access 2002 - Modifying Properties Of Subform Fields

Feb 2, 2014

I have a Form with embedded Subform, everything works well as far as moving through records. Scrolling through records on main table via Form brings up correct records of child table on Subform, so the link between the 2 tables is done properly.

I use this logic to lock/unlock a field in the subform.

Code:
Private Sub Form_Current()
If IsNull(Me.Parent!Spec2) Then
Me!Value2.BorderStyle = Transparent
Me!Value2.SpecialEffect = Flat
Me!Value2.BackStyle = Transparent

[Code] ...

I confirmed with debug that the logic does set the properties properly. They are updated once and that's that. Any further passes through the logic do not update on the form. They do pass through correctly, changes are just ignored.

It doesn't matter if I use the logic from the Form and refer down, or in the Subform and refer up, the Subform never gets updated. I tried Repaint, Refresh, Requery, nothing works. I cannot count the permutations I've tried.

View 9 Replies View Related

Setting Database Properties (i.e., Revision Number)

Jun 29, 2005

Good afternoon,
I have finished completing the initial version of a database and am now ready to begin the testing phase. When looking at the database properties (Specifically - "Statistics") there is a "Revision Number", which is always blank. I expect some changes and would like to set the Version Number each time I make a revision. How do I set the "Revision Number" found under the Statistics tab from Database Properties which was pulled from the "File" button on the toolbar?

Thank you,

Scot

View 8 Replies View Related

Forms :: Setting OnDblClick On A Subform

Jan 5, 2014

I have a form frmDisplayVars with a subform subfrmDisplayVars. The sub form initially has its RecordSource set to "" and is set dynamically from a maketable when needed.In the OnLoad for the main form, the subform RecordSource is set to a table "Table.Test". This is so that the load routine can execute a maketable query to create the form "Test" in advance. This produces a table from a crosstab query. All this works OK so far.

However, I wish to be able to double click on the datasheet in the subform to then open another form with data related to the cell/contol that was clicked on. Essentially creating a room occupancy table for a range of dates and rooms. Rows are rooms and columns are dates.

I have a problem with setting the OnBblClick for the subform controls.For example the 2 test code lines for the control "RoomName" illustrate.

Code:
Forms!frmDisplayVars!subfrmDisplayVars.Form!RoomName.Name
Forms!frmDisplayVars!subfrmDisplayVars.Form!RoomName.OnDblClick = "=TestMe()"

The first line works fine and returns as it should the name of the control "RoomName".It is the second line which I need to set the event code for OnDblClick which fails with error no. 2455 which suggests wrong syntax for referencing a control on a subform.I can't set the event procedures manually as they are not known in advance until the table "Test" is made so need to be able to set the control events dynamically.

View 8 Replies View Related

Forms :: Can't Edit Or Add Any Data In The Subform Results With Previous Setting

Mar 28, 2015

i've got a Form that contains Subform with an embedded Query that contains 2 tables only (Payments & Invoices) the Join properties between them show all records from payments and what matches it from Invoices where the joined fields are equal (Invoice no).. So, when i enter certain data in the main form the Subform show the results for it from Payments table and only one field needed from the Invoices table !!

The problem is.. i can't edit or add any data in the Subform results with the previous setting, but when i completely remove the Invoices table from the embedded Query then swift to the Form and it's Subform.. i become able to edit and add data in the Subform easily... !!

So, how to enable the edit/add in the Subform with the 2 tables in the embedded Query ?! Cause it's really needed to show that field from the Invoices table.

View 3 Replies View Related

Subform Properties

Feb 9, 2005

Am sure this is an easy question but I'm missing something:

How in the heck are you supposed to get to the subform properties box. The only way I know is to click on the very thin border area surrounding the form and then try and right click your way to properties. There has to be an easier way. Usually I have to fight my way to the properties box as the area loses focus by the time I right click and I have to reselect and try and right click again...ARGH!

View 3 Replies View Related

SubForm RecordSet Properties

Mar 3, 2006

So far I had several Subforms which would open in a mainForm depending on the combo box value. My combo box values were exactly the same as subform names so that I can easily change subform.recordsource = combo.text and it would show the proper form. Now, I'm thining, instead of having all those forms, I could have only one form and just changing it's recordSource property with the sma combo box, but this time, combo.value would be the name of the SQL string that the form needs to take as it's recordSet.

What I want to know is, if this will work at all, and if it would, where do I have to set my vars...in the Form_load()?!:confused:

tnx

D

View 1 Replies View Related

Subform Blues - Data Entry Setting Itself To 'No' & Requerying 1 Subform From Another

Dec 5, 2006

2 Subform problems

I have a data entry subform that is only supposed to show an empty record ready to be populated, and a display records subform that is supposed to show all the records. The subforms are both on the same tab of a tab control on my main form.

Problem 1:
The data entry subform shows all the records rather than a blank record. Something on my main form is causing it to show the records when it should not. Any ideas? The Data Entry is set to Yes.

To try to isolate the problem, I created a new form and added the subform to it where it behaves properly:confused:

I then added Me.DataEntry = True to the form open to see if that would solve my problem but it still sets the data entry to no.

If I have the properties box open when in form view of my main form, I can set the data entry to Yes and it works fine until I move to the next record of the main form when it resets to no. Teraing my hair out here.:mad:

My final attempt was to search the entire project to see if there is a "DataEntry = False" somewhere but there isn't. What is setting this property? Any ideas where I should look?


Problem 2:

After entering data in the first subform (data entry form), I want to re-query the second subform but I just can't get the syntax right. I have wrestled with the "Syntax for subs" document downloaded from http://www.mvps.org/access/forms/frm0031.htm (Microsoft MVP site) but to no avail.

My main form is called fdlgPrjDetails, the data entry is via fsubPrjCommentsUsersDataEntry and the subform I wish to requery is fsubPrjCommentsUsers.

None of the attempts below worked giving a cannot find control error.


Private Sub Form_AfterUpdate()
On Error GoTo ErrHandler

Me.Requery

'Me!fsubPrjCommentsUsers.Requery
'Me!fsubPrjCommentsUsers.Form.RecordSource.Requery
'DoCmd.Requery ([fsubPrjCommentsUsers])
'DoCmd.Requery [fsubPrjCommentsUsers]

ExitHere:
Exit Sub

ErrHandler:
MsgBox Err.Number & " - " & Err.Description & Chr(13) _
& Chr(13) & "Error in fsubPrjCommentsUsersDataEntry: Err 003"
Resume ExitHere
End Sub


Any Ideas?

Both problems have me stumped so I'll be grateful to anybody with a scoobie on this.:)

View 10 Replies View Related

Modules & VBA :: Filter Properties Not Working First Time On Subform

Jan 13, 2015

I have a form that uses a listbox. I can select multiple items and then update a subform. When I press a button with VBA and use the filter property on the subform for the first time, nothing happens. When I press the button a second time, it does - and it works thereafter with different selections. It only happens that first time, after loading the form and pressing the button for the first time.

I have tested that the list items are accessible via the vba variables and stepping through my code and the problem starts with the filter properties.

the statement:

Me.sbfrmCluster.Form.FilterOn = True
Me.sbfrmCluster.Form.Filter = strFilter

is not switched on first time (I have tried a requery and refresh statement after this). When I step through the code the first time, the FilterOn property remains false. A second button press and it is fine.

View 2 Replies View Related

Table Column Name Properties/Combo Box Head Properties

Dec 8, 2006

Hi, I would like to change the properties of either the column heads in a combo-box or the column names for tables. I don't think there's any way to adjust the column head properties, and I'm doubtful there's a way to change the column caption properties.

Some of my column titles are long, and I'd like to be able to word wrap them essentially. Anyone know if this is possible? Thanks.

View 5 Replies View Related

Setting Subform

Jan 17, 2008

Hi,

i have a subform within a form. when the form is loaded, i would like the subform to automatically be ready for a new record instead of shown the last record entered. i have tried various macros ( not VB ) but to no avail. the form shows the persons info and needs you to add a certain piece of info. this would be the only reason for the form.

can it be done?


NS

View 1 Replies View Related

Need Help Setting Up A Pop-up Subform.

Apr 30, 2008

I’ve created two forms, Form_A (parent) and Form_B (child). Each form requires key-in data and performs its own independent calculations based-on various tables and queries. I would like to have Form_B pop-up (like a dialog box) into Form_A. It’s important that Form_B maintain its ability to receive key-in data. Also, a control button inside Form_A used to display Form_B would work.

Thanks in advance.

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

Setting The Position Of A Subform Scrollbar

Nov 12, 2005

Hi everyone,

I have a 4 part survey database consisting of one source table : tbl_survey. I have created a main form with 4 subforms (each subform is a section from the survey table tbl_survey).

I have placed 4 buttons in the main form, and each button when clicked reveals its subform, whilst hiding the others. So when the main form opens, the first subform is displayed (others are hidden). When the user finishes the first subform, they click on the second button to display the next subform and so on.

My question is, i want to set the verticle scrollbar position of each subform to the very top when its appropriate button is clicked so that if a user goes back to a previous subform, the scrollbar isnt all the way down the bottom.

Reptar

View 11 Replies View Related

Set Properties In Non-loaded Forms

Feb 17, 2006

Hi all,

I would like to set the filter property in some forms that are not loaded. Does anybody now how these forms and their properties can be accessed via VBA?

Cheers

View 1 Replies View Related

Chek Properties Of Closed Forms

Jun 25, 2006

I have a remote DB with some Forms. Some forms have commandButtons in them, and some don't.

I have a Table called "test" in my current DB.

I need to look for command buttons in each Form, and populate their names into my "test" table.

Is it possible???

View 2 Replies View Related

Queries :: Setting Control Source After Running Subform

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

Forms :: Data Properties Appears To Be Overridden

Oct 18, 2013

I have a form called frmElements which has its Data Entry and Allow Additions properties set to 'No' so that only existing records can be edited, this is all good and works fine when used from the Navigation Pane.

I have created a macro which opens this form from a button on the ribbon, this is where the problem lies because it opens the form and allows new records to be added, I know this because there is an empty record with an '*' at the bottom of the form. If I change to design mode the Data Entry and Allow Additions properties are still set to 'No', when I then change back to form view the form functions as it should.

It does not seem possible to set form properties using the macro builder and it appears to override the forms property settings.

I am using access 2010 on a Windows 8 machine.

View 5 Replies View Related

Forms :: Locking Row Source Fields In Properties Menu?

Mar 5, 2013

Is there a way to lock the row source fields in the properties menu as currently it keeps creating exceptions (WHERE) onto the end of the SQL this is subsequently causing me major issues in the view of the form/datasheet as fields keep appearing as blank when there is actually values stored within the table.

View 5 Replies View Related

Forms :: Textbox Default Value - Reference To Object Properties

Jun 4, 2013

I want to refer to an objects properties in form: ie...

set a textbox's default value = textbox.name (me.name?)

How do I set this in the form's default value (...without using VBA).

View 6 Replies View Related

Forms :: True / False - Form Properties Based On Field Value

Sep 10, 2014

On my form ECOs

When my text box RELNUM is > 0 I want form properties AllowEdits set to FALSE.

When RELNUM is null I want form properties AllowEdits set to TRUE.

This must be possible, but not entirely sure where to start.

Since I can scroll through records in this form I'm thinking I have to put an event in ON LOAD, bbut beyond that I'm at a lost.

View 11 Replies View Related

Forms :: Updating Form Properties Dynamically - Command Button To Display Mode

Apr 16, 2014

I have a single form which becomes either readonly or editable or addnew using a circular toggle switch. The toggle switch is activated by a command button and the caption of the command button is used as the display of the mode.

The SetAddModeBt is a separate command button that initiates the add mode. The problem is that various form or field properties when defined on the fly are not stored and they get lost when you open the form again. Look at the code below:

Code:
Sub tglEditBt_Click()
'-------------------------------------------------------------------------------
' Circular toggle button to change display mode of the form
' ReadOnly - Edit - Add
'-------------------------------------------------------------------------------
' On Error GoTo NotFound
Dim ForName As String
Dim strSQL As String
Dim FMode As String

[Code] ....

Here the first two cases fail when executing the last statement saying it is not supported.

View 5 Replies View Related







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