Hide Subform If Criteria Is Met

Apr 12, 2006

Hi,
I have a main form which has a subform with another subform in it. Subform 1 gives details of a loan and a balance field which is calculated in subform 2 after amt paid is entered - using a macro on exit.

If the balance is zero after amt paid is entered. I want the amt paid field in subform 2 to be locked or disabled - preventing the user from entering further payments by mistake.

How can I do this?

View Replies


ADVERTISEMENT

Hide Command Button If Criteria Is Met?

Feb 4, 2005

Hi Guys. I want to Display a command button on a form dependent on the value of another control.

I have a Main Form: frmSalesOrders and a Sub Form frmSalesOrderDetails

I have a command cmdSpecialInvoice on frmSalesOrders.
On Form Load I hide this.

However if the user selects a MakeID from frmSalesOrderDetails with an ID of 61 I want the button to be visible.

I attempted to put this on the After Update Event of control 'MakeID'


If Forms!frmSalesOrderDetails!MakeID = 61 Then
Forms!frmSalesOrders!cmdSpecialInvoice.Visible = True
End If


I got an error stating could not find frmSalesOrderDetails?

That aside is it possible to do what I want?

Note:
MakeId is a combo. Takes its value from qryMakes if tht makes a difference.

Any ideas?
Cheers,
Phil.

View 6 Replies View Related

Criteria To Show / Hide Box On Continuous Form?

Oct 27, 2015

I want to show or hide a box on a continuous form. If there is a date in the ShopOut field i want the label to show up , if not then it will not appear.

I am trying

If IsNull(Me!ShopOut) Then
Me.StillinShop.Visible = True
Else
Me.StillinShop.Visible = False
End If

however, it shows the box whether there is a date in ShopOut on not. Is it possible to do this in a continous form or do i need somekind of me.record#.ShopOut or something.

View 2 Replies View Related

Reports :: Detail Format Event - Hide A Row Based On Criteria

May 1, 2013

I need to hide a row in my report for example (in Detail Format event of the report):

If me.txtReleased = "YES" then
hide row
endif

View 4 Replies View Related

Hide Subform If No Records

Jul 27, 2005

Hi,
Is there a way to hide a subform on a main form if there is no records in the subform?
Thanks

View 14 Replies View Related

Suppress/Hide Blank Row In A Subform

Jul 27, 2006

I need to suppress/hide a blank row on a subform.
The Main form is based on a table, contains Site Header information
The Subform is based on another table containing Sample Details records

Site Header table to Sample Details table relation ship is one-to-many,
with two key fields SiteID and SiteVisitDate

The Form/SubForm is linked by SiteID, SiteVisitDate

The form adds one record to the Site Header Table.
Then adds mutliple records to the Sample Details table for that SiteID.
Some fields are populated with a script, while others are populated by user input

An empty/blank/new row always appears on the subform before & after the Sample Details are added. The blank row Before new records are added is not a problem but when it appears after new records are added is a pain

I've tried CanShrink etc,

Any help appreciated

Cheers,
Michael

View 6 Replies View Related

Reports :: Hide Text Box If A Subform Is Empty

Aug 30, 2013

I have a report with some subreport in it. I have there on top a textbox with the title of the subreport. What I need is that if there is no data in the subreport, it should be invisible and only show up when there is data in the subreport.

View 3 Replies View Related

Forms :: Hide Subform Headers On A Report

Feb 28, 2014

I have a report which has a subform attached which I print it to a dot-matrix printer so I can use carbon paper.

The subform has shaded headers which look on the screen, but bot when printed with dot-matrix.

Can un-shade the headers or even hide them?

I attach a screen shot for reference.

View 4 Replies View Related

Modules & VBA :: Hide Subform When Main Form Opens

Jan 9, 2015

I need to hide my subform on load or open of the main form but am experiencing some weird results. I have tried putting Me.SubForm.Form.Visible = False in both the on open and the on load of the main form and it works only if the tables on which the subform have records in them. If the tables for the subforms are empty I get an error 2467 telling me that "The expression you entered refers to an object that is closed or doesn't exist." I find this strange because from all I can find the subform loads first.

How can I hide the subform when the main form opens no matter what records exist or don't?

View 6 Replies View Related

Forms :: Way To Display / Hide Information On Subform Using Check Box?

Jul 11, 2013

Is there a way to display/hide the information on a subform using a checkbox?So, when the checkbox is checked, the fields are blank but when the checkbox is unchecked, the information displays?

View 5 Replies View Related

Modules & VBA :: Hide Subform Footer Controls If No Records Present (AC2007)

Mar 14, 2014

I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.

The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.

So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)

I want to be able to hide the controls in the footer section once the subform has been cleared of all records.

But not sure

a) how to determine when the subform's recordset reaches zero and

b) what event to use to fire the code to hide the footer controls.

This is my basic attempt :

Code:
Private Sub Form_Current()Dim ctl As Control
For Each ctl In Me.FormFooter.Controls
ctl.Visible = Not (Me.Recordset.EOF)
Next ctl
End Sub

But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)

I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.

View 6 Replies View Related

Forms :: Show / Hide Main Form Buttons When Clicking Into Subform

Dec 11, 2013

I'm currently building a database in Access 2013. I've used Access many years ago, and not really in anger since maybe 2003, so I've been re-learning quite a lot. Here's an overview of my scenario, and issue:

The main purpose of my database is to allow engineers to log various bits of information when building, servicing and testing manufactured products for offshore exploration. Because some of the engineering team aren't so great with data entry etc, I've decided that, rather than deleting data, I'm going to use a 'deleted' flag: user clicks what he considers to be a delete button, but in reality an update query will simply update the flag and, because the form is built on a query which includes a 'where deleted = 0' filter, it'll no longer be shown. This will allow us more control over the data and will also allow me to check that everything is running okay.

My main forms include a number of subforms, including one which includes a second tier of nested form: Pin Maps for (electrical) Connectors.

What I need to achieve is fairly straightforward: as the user navigates around the form, I'd like a 'delete' button which is specific to that subform to become visible and for any other 'delete' buttons to become hidden. Once tested, the buttons would be 'stacked' in the same position at the top of the main form, so the user just thinks they're deleting the relevant record in the sub, or main, form.

View 7 Replies View Related

General :: Main Form With Two Lists Boxes - Show / Hide Datasheet Columns In A Subform

Aug 24, 2012

I've got a main form with two lists boxes. I want to show the visible columns in my subform (which is a datasheet) in one listbox and show the hidden columns in the other. Also I want to allow the user to hide / show columns using right or left arrow buttons between the list boxes. My subform is bound to a stored procedure using ADO.

View 5 Replies View Related

Auto Rearrange Fields Or Hide Fields In DataSheet Based On Criteria

May 17, 2007

I have main form and that has one sub-form , this Main form governs/determines the data in the sub form.

This Sub form ( DataSheet Mode) has approximately 130 columns and based on the Main form criteria only ~ 20 columns has to be filled.

What I want to do is based on the main forms criteria I want to show only the columns that are applicable to main form criteria.

If I use Columnar or Tabular single form for the Sub Form I am able to hide the fields that are not required BUT IT LEAVES A SPACE/GAP on form ( for the hidden fields that are not required)

Private Sub Form_Load()
If Forms!frmShowPIforActiveAndCanAddNewPI!FrmSubFrmFi lterProductInformationPerFMT!CASETIF = True Then

Me.CASETIF.Visible = True
Else
Me.CASETIF.Visible = False
End If
End Sub


And If I use DataSheet and hide ( visible = no) a particular filed it still shows up in Sub Form

Is there a way to Auto-Re Arrange all the fields in the sub form so that the hidden ( visible = no) fields no not leave gap


Or is there a way by VBA program to select fields ( Columns) from a table to be displayed on a sub form based on a criteria

Thanks
Rahul

View 1 Replies View Related

How "hide" A Subform That Is In Focus

May 6, 2005

I have a mainform (f1) and a subform (f2). The subform normally is not visible ([Fomrs]![f1]![f2].visible = Fasle). When I click on a command button on the main form, the subform wiill show up on the main form ([Fomrs]![f1]![f2].visible = True). There is another command button on the subform. When I click on the button, it opens up a third form (f3). The relationship between f1 and f2 is master-child, and the relationship between f2 and f3 is also master-child.

After I open the third form, I want to close (hide) the subform (f2), but I got an error saying that I can not "hide an object that is in focus".

Do you know any trick to do that? Thanks a lot.

Zoo

View 1 Replies View Related

Help With Wildcard Criteria On SubForm

Feb 21, 2005

I have a form with subform which use six fields on the form to determine
what data is returned in the subform. As long as every field has a valid entry the data is returned
correctly. What I would like to add to this is if a particular criteria field is left blank it will return all
values in that field. The current SQL Statement looks like this:

SELECT QryItemQtyProductLineLinked.FINISH, QryItemQtyProductLineLinked.SIZE, QryItemQtyProductLineLinked.COLOR, QryItemQtyProductLineLinked.BASISWGT, QryItemQtyProductLineLinked.PRODUCT_LINE, QryItemQtyProductLineLinked.MWIEGHT, QryItemQtyProductLineLinked.DFLT_VENDOR_ID, *
FROM QryItemQtyProductLineLinked
WHERE (((QryItemQtyProductLineLinked.FINISH)=[Forms]![FrmProductLineLookup]![MatchProduct]) AND ((QryItemQtyProductLineLinked.SIZE)=[Forms]![FrmProductLineLookup]![MatchSize]) AND ((QryItemQtyProductLineLinked.COLOR)=[Forms]![FrmProductLineLookup]![MatchColor]) AND ((QryItemQtyProductLineLinked.BASISWGT)=[Forms]![FrmProductLineLookup]![MatchBWeight]) AND ((QryItemQtyProductLineLinked.PRODUCT_LINE)=[forms]![frmproductlinelookup]![MatchProduct]) AND ((QryItemQtyProductLineLinked.MWIEGHT)=[Forms]![FrmProductLineLookup]![MatchMWeight]) AND ((QryItemQtyProductLineLinked.DFLT_VENDOR_ID)=[Forms]![FrmProductLineLookup]![MatchVendor]));

Thank you in advance for any help!

View 2 Replies View Related

Using Optional Criteria For A Subform Query

Sep 4, 2005

Hi,

Is there a simple way to add optional criteria in a query for a subform? Basically, what I'm trying to do is have a number of comboboxes in the parent form that indicate what records are shown in the subform (these records could then be added and/or deleted). I would like to be able to have a combobox such as "Month" that would filter the data shown in the subform to that month. If no month is selected, then the subform would show all months.

Any help would be much appreciated.

View 2 Replies View Related

Query Criteria Cannot Reference Subform

Jul 19, 2007

Hi,

Trying to run an append query for a specific record on a subform but won't recognise the subform control.

The Master form is fmSickEdit do I have to reference the Master file in the SQL?

The SQL for the query is:

INSERT INTO tblDisLetter ( SickID, DateAdvisedDisciplinary )
SELECT tblSick.SickID, Date() AS [Date]
FROM tblSick
WHERE (((tblSick.SickID)=[Forms]![fmsubSickListEditVersion]![SickID]));


Thanks

View 2 Replies View Related

Using VBA To Set Criteria In A Query And Refresh A Corresponding Subform

Dec 20, 2007

I have a Main Form, "frmBuildingSearch", which has a subform "frmBuildingSearchSub". frmBuildingSearch has a couple of input text boxes & 1 command button: txtCity, txtSite, txtBuilding, cmdSearch.
I want the command button to refresh my subform (which is run from a query, "qryBuildingSearch") based upon the text that is in the text boxes.

If there is any value in txtCity, then I would like to set the criteria of my City field in the query to:
Like "*" & [Forms]![frmBuildingInfo]![txtCity] & "*"

The same would go for any value in txtSite and txtBuilding.

I would like to use VBA to do this.

View 2 Replies View Related

General :: More Than Two Criteria To Filter A SubForm

Sep 28, 2012

I need to filter a subform based on the values on the mainform.

Criteria are Multiple. The idea is to show the user the records that are already existing in the table.

First two criteria works, stuck with the third one

I.Criteria - Creative(text type)

Private Sub Creative_AfterUpdate()
Me.frmCommercialWithDetails_subform.Form.Filter = _
"Creative ='" & Creative & "'"
Me.frmCommercialWithDetails_subform.Form.FilterOn = True
End Sub

[Code] ....

Also, how to split the code into two lines

"Creative ='" & Creative & "' And Act_ID = " & Act_ID

when broken into:

"Creative ='" & Creative & "' _
And Act_ID = " & Act_ID

is automatically saved as:

"Creative ='" & Creative & "'" _

And Act_ID = " & Act_ID " and this generates an error on execution.

View 5 Replies View Related

Using Subform Entry As Criteria In A Query

Nov 14, 2012

I have the following Form and Subform. Form name is "100-Select Form". Subform name is "103-Report Dates". Within the subform I have two fields I'm using, "Start Date" and "End Date'.

In my query I have a date field. I want the query to read from the Subform (if I open the subform directly my criteria listed below works, but when the main form is open, my query doesn't seem to be able to read from the subform).

Here is the criteria I have in the date field of my query: >=[Forms]![103-Report Dates]![Start Date] And <=[Forms]![103-Report Dates]![End Date]

I have a feeling that I somehow should be pointing my criteria first to '100-Select Form', and then to '103-Report Dates' within that form, but I'm just not sure how to write this and nothing I'm trying is working.

View 2 Replies View Related

Using Current Data On SubForm As Query Criteria

Feb 6, 2005

I have a Form> [Management]

I have a SubForm> [Management_History]

There is data in the [Year] field and the [Season] field.

I placed a button on the subform to create a report based on the data of the current "Sub Record" .

Basically, I want to use the data in the subform to create a small "Lookup" report.

OK:

I have the Management Form
I have the Management History SubForm
I Placed a Button Called PRICE LIST
The button kicks off a Macro that previews my PRICE LIST REPORT
A Query is the RECORD SOURCE for my PRICE LIST REPORT.

In the QUERY, I have two fields that I specify criteria "hopefully" based on the sub form record I am viewing.

I does not work on the SubForm. However if I Open the SUBFORM directly, the report pops up correctly.

What syntax in my QUERY is required to GET the data right frm the current SUB-FORM??

I tried the following:

Like [Forms]![Management]![Management_History].[Year]

Like [Forms]![Management]![Management_History].[Season]

View 2 Replies View Related

Opening A Subform Based On Criteria From A Combo Box

Sep 30, 2004

The posting in archive t-31918 was very helpful and almost does the trick. I have a subform with gifttype that has only giftID and gifttype. There are four different gift types and I need a subform to open in a specific location, as a subform. The code given by the archive (my version):

Private Sub Gifttype_AfterUpdate()
If Me.[Gifttype] = "restricted/unrestricted" Then
DoCmd.OpenForm "frmgift1"
ElseIf Me.[Gifttype] = "planned gift" Then
DoCmd.OpenForm "frmplannedgift"
End If
...

Opens what I want as subform as a regular form.

How can I get the correct subform to populate a certain area on the master form?

Thank you!
Pat Wright

View 1 Replies View Related

Filter Form Based On Subform Criteria

Feb 28, 2005

I need to open my form with a filter attached that is based on criteria already existing in the subform. I've tried putting the following code in the OnOpen event of my main form :
Code:Dim stDocName As StringDim stLinkCriteria As StringstDocName = "Campaign Form"stLinkCriteria = "[Campaign - Last Contact Status subform].Form![Communication Response] in ("2","4","10","11")"DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormPropertySettings, acWindowNormal

Basically I want to open my main form (Campaign Form) and only show records where the "Communication Response" is 2,4,10 or 11(a variable on my subform "Campaign - Last Contact Status subform"). Which in itself is a problem because I can't seem to code all of these variables- it will only accept one.

When I run the above code I am getting asked to enter a parameter value for "Campaign - Last Contact Status". I'm not too sure where this is picking this up from or how to fix it. I've even tried to run this based on the underlying query of "Campaign - Last Contact Status subform" with the same results.

Can someone help me? All I want to do is open the form based on the criteria I specify which is contained in a field in the subform. It doesn't sound that hard but it seems to be getting the better of me!

View 4 Replies View Related

Filter Main For Based On Subform Criteria

May 2, 2005

Hi,
I've posted this same question a few months ago, started something else and forgotten about the problem, now I really need to solve this! (I had no luck with the original post - code still not working).

I want to apply a filter to my main form based on criteria showing on a subform. This is the code I've got (applied to the OnOpen event of the main form):

Code:Private Sub Form_Open(Cancel as Integer)Dim stDocName As StringDim stLinkCriteria As String stDocName = "Campaign Form"stLinkCriteria = "[Forms]![Campaign - Last Contact Status subform]![Communication Response]=1" DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria, acFormPropertySettings, acWindowNormalEnd Sub

The main form is called Campaign Form
The subform is called Campaign - Last Contact Status subform
The field I want to filter on is Communication Response

The criteria I want to filter is : I only want to show records from the Campaign Form (main form) where the status of the Communication Response on the Campaign - Last Contact Status subform (subform) is equal to 1.

I've tried a few variations of the above code but the results are always the same - prompting to enter a paramater value. Now I'm just fishing and hoping I'll get it right.

FYI. the subform only contains one record for each record on the main form. It works a bit like this :
Customer||Date||Communication Response(1=open, 2=closed)
One||20/4||1
Two||21/4||2
Three||21/4||1
One||23/4||2

The corresponding record on the subform for customer One will show the communication response of 2 as this is the most recent date. Therefore you now have the following :
Customer||Communication Response
One||2
Two||2
Three||1

Now I want to only show those records that have a Communication Response of 1. Remember this field appears on a subform. This is the part I am having trouble coding.

I know I've probably just explained the most irrelavent details but if anyone can help me it would be greatly appreciated!!

View 1 Replies View Related

Queries :: Textbox On Subform As Query Criteria

Jun 3, 2013

I'm trying to build a query to use as a filter in the DoCmd.OpenForm function.

I have done this several times before, referencing values from forms e.g.

Point To
Field: LeadID
Table: Lead
Criteria: [Forms]![GridDisplay1]![LeadID]

This filter is used in the procedure:

Code : DoCmd.OpenForm "LeadDetails", acNormal, Point_To", , , acDialog, """"

And it works great, I click a button next to the record I want to select (records displayed on continuous form) and it opens the Lead Details form on that particular record.

However now I am trying to accomplish the same thing, except instead of a continuous form I need to draw from a continuous sub-form. The form "BrokerMgmt" contains a sub-form named "BrokerSearch." The RecordSource for the sub-form is set once the user enters data into a few textboxes on the main form and clicks the search button:

Code:
Private Sub brkSearch_Click()
Dim argCount As Integer
On Error GoTo Err_Handler
If IsNull(brkFirstName.Value) And IsNull(brkLastName.Value) And IsNull(brkCompany.Value) Then
MsgBox "You Need To Select Some Values", vbCritical, "Lead Tracking"

[Code] ....

The sub-form then displays basic info such as Name, Company, State, and the "BrokerID" which is the primary key of the "Broker" table. This "BrokerID" is displayed in "Textbox 20" so I set a button next to each result to on_click perform the procedure:

Code:
DoCmd.OpenForm "BrokerDetails", acNormal, "Point_To_Broker2", , , acDialog, """"
"Point_To_Broker2" is set up in the same style as "Point_To":
Field: BrokerID
Table: Broker
Criteria: [Forms]![BrokerSearch]![Text20]

However instead of the BrokerDetails form opening to the appropriate record I get a msg box asking for a parameter. Why is this? Even if I enter the correct BrokerID as the parameter it still gives me an error saying you can't go to the specified record.

View 11 Replies View Related







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