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 Replies


ADVERTISEMENT

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

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

Hide Records

Jul 25, 2006

HI,
I have made form with a main form and a sub-form. The relationship between them are 1-t-many. The main forms key is security-number and based on this number the sub-form shows all the related accounts. One field on the sub-form is total arrears - and here comes my ?. Based on this calculated field - total arrears I would like to only show accounts if the total arrears are > X. Otherwise the main form - security-number should be the next in line.

I’m looking forward to hearing your suggestions. Thanks

BR

Henrik

View 1 Replies View Related

Hide Unused Records

Oct 18, 2004

hello
could anyone tell me that is there any way to hide the unused records or the records that have a null value.
tx in advance.

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

Forms :: Hide Records That Have 1 In Combo Box

Jun 10, 2013

I have a form with a checkbox and a combo box. When I click the checkbox, I would like it to only show the specified records that are in the combo box. The current code I have is this:

Code:

Private Sub chkHideComplete_AfterUpdate()
On Error Resume Next
If Me.chkHideComplete = True Then
Me.filter = "[ReservationStatus] = 3"
Me.FilterOn = False

[Code] ....

I basically want to hide all records that have "1" in the combo box.

View 2 Replies View Related

Reports :: Move Or Hide Duplicate Records?

May 8, 2013

I'm having trouble with one of my reports. attached is a screencap of my report. The second name which is highlighted i need to either nudge it to the right so it is not directly under the first name OR remove it completely but keep the times and a gap for the next record.

I am creating is a sign in database where staff sign in/out for each day of a week. the issue is when the staff member signs in/out in the morning and then does the same when they get back from lunch it is difficult to read. This report is only printed once a week and will not show after a time frame of 5 days.

So, i still need that name to show up for the next day.

View 1 Replies View Related

Reports :: Hide Or Filter Out Empty Records

Apr 29, 2015

I am looking for a way to hide or filter out the records in my reports if all of the values are 0. My problem is that all of my reports have their filters set on the event that opens the report. I use an If statement to decide which report to open, which means that different reports use different fields. This means I can't just add 'AND April_T <> 0' or something to the filter.

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

Modules & VBA :: Cycle Through Several Records And Hide Field If It Is Blank

Feb 10, 2014

I have code that I want to cycle through several fields and check instead of coding for each individual field. I thought this might worked on an earlier project but Im lost. When I try to add my code in the "If MyControls Then", I want it to hide the field on a report if it is blank. It doesnt allow me to do MyControls.Visible.

Code:
If Len(Reports!RecallReport!QAW1 & vbnullsting) = 0 Then
Reports!RecallReport!QAW1.Visible = False
End If

but I want the below code to go through each field With QAW in it and hide it if it is blank.Or having it go through each field individual. There are 10 Fields With QAW THen there are another 10 fiels with ShipDist. I would prefer a simple solution to check all at once.

Code:
Dim MyControls As Control
For Each MyControls In Me.Controls ' Iterate through each element.
If InStr(1, MyControls.Name, "QAW") Then
If MyControls Then
End If
End If
Next

I don't even know if I am on the right track or what.

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

Queries :: Mass Duplicate Main Records And Related Subform Records

May 29, 2014

In my simple database (attached), I need to mass duplicate Tasks and their Notes.

I have three tables: tbTasks (PK: Task_ID), tbNotes (PK: Note_ID), jtbTaskNotes (FKs: Task_ID and Note_ID). jtbTaskNotes is my many-to-many junction table that ties Tasks to Notes.

The main form (fmTasks), bound to tbTasks, has a subform (sbfm_TaskNotes) that displays notes associated with each Task. On themain form,you select which Tasks you want duplicated via a checkbox. The append query (quCopyTasks) will duplicate all tasks that have the checkbox checked. All good there. However, I can't figure out how to also duplicate each task's Notes.

I found Allen Browne's solution [URL] ....., but that only handles duplication of one record at a time, whereas I need to duplicate many records at a time (sometimes 10+ records). How do I go about duplicating multiple Tasks and their associated Notes?

Before you ask "why are you duplicating records?": There are times when tasks need to be re-accomplished and therefore need to have a new record. It's easier to duplicate records than it is to hand-jam everything again.

View 5 Replies View Related

Update Subform Records

Sep 29, 2005

I am building a debt management program in A2k. I have created a tabbed control which contains 6 pages based on a set of queries. These pages are a budget template and the intention is that when this form is inserted as a subform into the customers form the budget will open as a blank template with the budget categories displayed. The clients budget will then be entered and saved. The Budget table contains 56 budget categories.

At the moment when I insert the budget form and use it the only records that change are the template. I want the first 56 records to remain with zero values so that they display as blank for a new client but I want the total 56 new records to have the customer ID associated so that when that client record is accessed again their budget will appear. I have attached the SQL code for the query that displays a sub portion of the budget.

SELECT Budget.BudgetID, Budget.ClientID, Budget.SectionNumber, Budget.BudgetTitlesID, Budget.Description, Budget.Cash, Budget.Credit, Budget.Frequency, IIf([frequency]=1,([cash]*52/12),IIf([frequency]=2,([cash]*26/12),IIf([frequency]=3,([cash]),IIf([frequency]=4,([cash]/12),0)))) AS Totalscash, IIf([frequency]=1,([credit]*52/12),IIf([frequency]=2,([credit]*26/12),IIf([frequency]=3,([credit]),IIf([frequency]=4,([credit]/12),0)))) AS Totalcredit
FROM Budget
WHERE (((Budget.ClientID)=[forms]![customers].[clientid]) AND ((Budget.BudgetTitlesID)=1)) OR (((Budget.ClientID) Is Null) AND ((Budget.BudgetTitlesID)=1));

My thought was to do an after update event that would copy the clientID from the main form to the sub form and populate all the records in the budget. However, I have only succeeded in populating the individual record that has changed.

I probably haven't explained the problem sufficiently to get some help but would appreciate any thoughts.

Thankyou

View 2 Replies View Related

Limiting Records In A Subform To 24 - How To

Nov 17, 2005

Ladies / Gents !

I am writing a database for my work environment to enter sample numbers in a predefine batch. My Form contains information to identify batch ID. Attach to this form is a subform which I would like to limit the number of records to 24.

exsample: form : as unlimited records
subform: only limited to 24 records within the master form.

Now, everytime i create a new record in the master form , I should be allowed to enter only 24 records in the associated subform.

Does anyone have an idea on how to accomplish this !! Your help would be greatly appreciated.

Thank You

View 1 Replies View Related

Only Show 10 Records In A Subform

Nov 8, 2007

Hi all

I have a subform which loads the items from a table the form is non editable just for viewing the items, the problem is how can i
A. limit the subform to only show the first say 10 items in the subform
B, to have a command button on the form where the the subform is on (command button not in the form) and when the user clicks it it goes to the next set of records say from 11 to 21 and displays that in the form.

i tried doing record cound but somehow record count is not there when selecting, also would the code go in the subfrom on load or on the form load where the subform is based?

any help on this would be appreciated.

thanks.

View 7 Replies View Related

Subform Not Creating Records

Nov 11, 2004

Hi, im having a problem with shring my db over a networkt,

as far as i understand access 97 locks a page (2k) of records when a record is being edited,
does anyone know a way in 97 how i can get access to lock ONLY the EDITED record and not the page?

in Tools/Options/Advanced i have "edited record" locking clicked and each form locks only the record edited but its still locking the page, i know there is "record level locking" feature in Access 2002 but not in 97, is this possible?

thank you

Scott

View 1 Replies View Related

Passing All Records To Subform

Mar 30, 2005

I have a form called chartinfo which contains a subform called testgroup.
For ever new record in the main chartinfo form I need the testgroup subform to display all records from the testgroup table.
see attachment it is access 02

Thanks
Murlen

View 1 Replies View Related

Limit Records In A Subform? Best Way?

Jun 16, 2005

I have three tables;
tblPallet
PalletId
DateDespatched

TblBox
BoxId
PalletID

TblKitting
KITID
BoxID
Model

Process
The users will be adding a kitting item to a box. Only 10 items are allowed in a box (no more no less) and the box needs to have its own Id Number and then the box is placed on a pallet. 40 boxes are allowed on a pallet (again no more no less) and the pallet is despatched. Then a new pallet is set up.

I am trying to think of the easiest way to do this as I am a little new to Access. Any tips in the right direction would be greatly appreciated. I thought about a series of subforms from a main pallet form but am not sure how to introduce a limit to the number of records in a subform. Perhaps Ive bitten off more than I can chew (I hope not)

Many thanks

View 3 Replies View Related

Subform Creates Two Records

Aug 23, 2005

Hi,
I have several forms with subforms attached for data entry purposes. In a nutshell - this program is for an interview - where we need the respondent to give us a listing (say as to what intices them to join a study, etc.), but for some cognitive research method we need to be able to know the order they gave us the list in then we have them rank their list, thus the order may not be in the order they gave us the list. I hope that made sense. Anyway, when a form is called and loaded the subform always adds an extra record. Below is a screen shot of what I am talking about:

http://www.geocities.com/msfstl/ScreenShot/ScreenShot.JPG

So, not only do I get an extra record, but when I am entering data and get down to the new record line, the cursor will jump up to the top of the column. What can I do to prevent the extra record and also the cursor skip? I am thinking if I resolve one issue the other will fall into place.

Thanks,

Scot

View 14 Replies View Related

Saving Subform Records

Sep 14, 2005

I have a subform within a form and the subform has the child records for the main form. When I move from the main form to the subform by tabbing the records in the main form are saved. However, in the subform after it is completed if a certain field in a groupbox is chosed another form opens up which contains records in the many side of the relationship with the first subform. The problem is that the first subforms records aren't saved because the originall form isn't closed and I don't want it closed...How would I save those subform records when the new form opens up?

Thanks,

View 3 Replies View Related







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