Hiding a field from a sub form.

I know that this looks easy (and it probably is) but this is what I need to do.

I have this code that I can hide a field within the same form

' NI.Visible = Not NB

And this works just fine.

what I would like to do is Hide a Field from a Sub Form and I am hitting a 
wall.

I tried this, so please tell me where I am brain dead.

frmDateEntry!product.visible = not NB

Thanks in advance,
-- 
-The Novice
Learn Today, Teach Tomorrow

Great Success is ones ability to ask for Help.
0
Utf
5/18/2007 9:50:00 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
774 Views

Similar Articles

[PageSpeed] 20

On Fri, 18 May 2007 14:50:00 -0700, TheNovice
<TheNovice@discussions.microsoft.com> wrote:

>I know that this looks easy (and it probably is) but this is what I need to do.
>
>I have this code that I can hide a field within the same form
>
>' NI.Visible = Not NB
>
>And this works just fine.
>
>what I would like to do is Hide a Field from a Sub Form and I am hitting a 
>wall.
>
>I tried this, so please tell me where I am brain dead.
>
>frmDateEntry!product.visible = not NB

Referring to a Subform is a bit tricky. The subform is not part of the Forms
collection, as it's not open in its own right; you need to navigate to it from
the mainform, via the Name property *of the Subform control* container - which
might or might not be the same as the name of the form within that container.

For code on the mainform, it would be

Me!subformname.Form!product.Visible = <whatever>

If the code is in the subform, then you can just use

Me!product.Visible = ...

             John W. Vinson [MVP]
0
John
5/19/2007 12:00:16 AM
On Mon, 21 May 2007 09:16:02 -0700, TheNovice
<TheNovice@discussions.microsoft.com> wrote:

>Thanks John,
>
>I tried it and it still seems to give me a Run-Time Error '2465': that it 
>cannot find the field 'frmDateEntry'.
>
>Any Ideas as to why??

I presume because there is no field named frmDateEntry, or - more likely -
there is an error in your code.

Care to post the code so we can help debug it?

             John W. Vinson [MVP]
0
John
5/21/2007 5:16:09 PM
Reply:

Similar Artilces:

Can I change names of fields in calendar?
I am using a calendar like a project manager. I would like to change the names of fields eg Location to Action to be done, Contacts to Action officer. I have been able to change the column headings in Custome view, but this doesn't change teh names of the fields on the calendar form. That is teh form that appears when you make an appointment. No, you can't change them. You could use in-cell editing and create the items in table view, where the column display names can be changed. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook &a...

Memo Field Limited to 256 Characters?
I'm creating a report, imported from Excel, that contains a large "Description" field. ACCESS wants to limit me to only 256 characters in that field. Is this correct? Is there a work-around? TIA. memo fields actually support something like 63256 characters. are you sure it is not set as a Text field? those are limited to 255. On 1/11/2010 11:34 AM, ghetto_banjo wrote: > memo fields actually support something like 63256 characters. are > you sure it is not set as a Text field? those are limited to 255. > Good point. I'll check. That 256 c...

"Package" error/label when embedding a BMP in OLE field
I am still getting the 'package' label when I embed a bmp image in an OLE field in my database table. I had been trying to embed jpgs until I learned the OLE server does not support them and returns the 'Package' label; however I converted my images all to bmp and tried to embed them that way, but I still get the same 'Package' label. Any ideas?? Thanks in advance... ...

Set Query Criteria from Form
Thank you Thank you Thank you for your help... Concept: I have a report and underlying query object. I would like to be able to click a button on a form that would set the criteria for a field in the query and then run the report. Of course several buttons to set different criteria... One approach was to set a text box on the form that would be populated by code and that used as the criteria in a parameter query. I found out that I couldn't pass >= in the parameter which is part of the criteria. Is there a way through code to set the criteria for a field in an existing quer...

Action by popup form delayed, causing error
I have a form where users select various actions. If they select option 1 (from an option group), a popup form with a combo box is supposed to open where the user picks a value. The After Update event of the popup is supposed to store that value in a global variable, then close itself. When I run this process, though, my code errors out on the line FOLLOWING the OpenForm because the global variable is still zero. (True, because although the popup has opened, I haven't yet selected a value, buy why doesn't my code wait for the popup to finish doing its thing before worrying a...

Form and SubForm Problem
I have a table tblPhones with a PDkey as the Primary Key. I have another table tblPB with four fields as follows: DDID as the Primary Key PDkey, a lookup field to tblPhones. DirectoryID, a lookup field to a table tblDirectory DeptID, a lookup field to a table tblDepartment The Main Form uses tblPhones as it's record source The Sub Form has tblPB as it's record source Link Child Fields = PDkey Link Master Fields = PDkey I can create a new record in tblPhones from the Main Form, WITHOUT entering data in the SubForm. How do I make sure data is entered into the SubForm when adding a n...

Option to Hide Inactive Contacts
Hello Microsoft, I am requesting an option to be integrated into a future release of CRM. Currently (CRM 3.0) inactive Contacts are displayed when an Account record is opened, and Contacts is selected. Please implement one of the following: 1. a CRM-wide option or a user preference that would allow inactive Contacts to be hidden from the view described above. 2. display inactive contacts with a different icon or a different row background color so that there is a visual clue regarding the state of that contact. I have added the statuscode field to the Contact's Associated View - but...

pivot table calculated field question
Greetings. I have two questions: 1) I have a pivot table like the following A B Total sum(T1) sum(T2) sum(T1) sum(T2) sum(T1) sum(T2) In this table I need to add sum(T1) / Total sum(T2) as a calculated field. How do I do this? 2) I have a pivot table like the following A B runningtotal(T1) runningtotal(T2) runningtotal(T1) runningtotal(T2) I need to add runningtotal(T1)/runningtotalT2) (not runningtotal(T1/T2)). How do I do this? Thank you. ...

Updating Table with a form
-- Center for technica education I have Two Tables ,a Student Name Table with Two Fields, Student Id and Student Name the other table is a Rubic Table and has the same two fields along with other fields. I have created a form with a combo box(Names) on the form and I am trying to get the Name and the Student Id to be entered into the into the Rubic Table fields but I can't seem to get the Student Id to be entered. I know I am doing something stupid but I can't seem to make it work. Thank you in advance for all the help. You guys are great. On Mon, 17 May 2010 15:18...

Quick question - Report
I have two fields in a report that are "Memo" type. I defined this fields in a report as they can Grow and/or Shrink. However, the information on this fields is trucated. Any suggestions on how to correct this problem. Thank you for you collaboration and guidance. Luis luis.a.roman@gmail.com wrote: > I have two fields in a report that are "Memo" type. I defined this > fields in a report as they can Grow and/or Shrink. However, the > information on this fields is trucated. > > Any suggestions on how to correct this problem. > > Thank you for you col...

form validation determines which sheet to add data
Let's say I'm creating a form that a non tech savvy used car dealer uses to enter his newly acquired vehicles to the excel workbook. Each sheet of the workbook is a unique model year of the car. (That would allow him to quickly refer to all vehicles of a given year.) On the input form, I would like validation such that if he selected "2006" from the drop down list of vehicle years, the data from the form would be AUTOMATICALLY be added to sheet "2006", regardless of which sheet is currently showing at the time. What would the code look like? I su...

Problem displaying a form that runs queries
Hello, In Access 2007, I’m having a little issue displaying a form that runs queries on load. Below is my code. When I double click the form, the queries begin to run but the form only appears after the queries are done. If I put the code behind a command button it works fine. I can’t use a command button because I need the queries to run unattended when the DB opens. Where am I going wrong? Private Sub Form_Open(Cancel As Integer) DoCmd.MoveSize 2880, 4320 End Sub Private Sub Form_Load() DoCmd.SetWarnings False '********************************** 'QUERIES ...

SHADE ALTERNATE ROWS IN QUERY OR FORM DETAIL
I would like to shade alternate rows in a query (or similar tabular format in a form). Is this possible, and how do I accomplish this? -- Thank you for your time and any info. -Diane It cannot be done in a query. Stephen Lebans has an example of how to do it in a form at http://www.lebans.com/alternatecolordetailsection.htm (and it's far easier than that in Access 2007) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Diane-Maplewood" <DianeMaplewood@discussions.microsoft.com> wrote in message news:F14C865E-AF1D-4960-9645-912B8FE...

Create a form in one database and then copy and paste to another
You guys have been great with your help. I created a form in a database, quite by accident that I got it the way I wanted it as I am still learning by trial and error, and reviewing this board... Anyway, I created this form, tried to twick it and screwed it up totally. I have the form before I messes with it backed up on a zip drive. Is there anyway to copy just a form from one datebase and place into another database? There is also a few forms in templates that would work great for me with just a minor adjustment here an there, but how can I get them into the database without cre...

Field appear twice
Is it possible for a field to appear on 2 different tabs within the contact form. I have a custom tab with a field called membership number. I would also like this field to appear as read only on the General Tab. Thanks No, the only way to 'fake' this is to create another field and populate that field during the on change event of the original field. Kind regards, -- Erik van Hoof CWR Mobility Check our weblog at: http://www.cwrmobility.com/weblog "Tango" <Tango@discussions.microsoft.com> wrote in message news:4C2DF4A9-4BC1-45D7-BAC4-191AE477955F@microsoft.co...

Help! on filtering a report using a form & query
Hi. I've got a database with lookup fields. I have a form, a query and a report whose record source is the query. I want the user to select the lookup field from a drop down combo box And then run the query. If I change the query so the the criteria reads: [Forms]![frmCloseOutFilter]![txtCollection] and then run it, it will prompt me for the collection, I type a "3" and I get the desired results. It also works If I then run the report separately. But, If I try to run it from the form, I select my collection (It's a two column combo box, the first column has a width of 0...

Bug: VBA Range.Copy throws Error 1004 when Form visible
I am reporting a VBA bug. I hope this is the right place to do that. I'm in VBA writing macros for Excel 2004 with Mac OS X. It seems that an Error (code 1004 I think) gets thrown whenever the Copy method of a Range gets called while a Form is visible. The Copy method works if I hide the form before using it. For example, in code for a VBA form in an Excel workbook: Private Sub CommandButton2_Click() Worksheets(1).Range("A1").Copy ' Throws Error 1004 End Sub Private Sub CommandButton2_Click() Me.Hide Worksheets(1).Range("A1").Copy ' Works, n...

hide printing
Hi, I would like know how to hide certain cell. while printing. exampl if C1 is no value i want to hide A1 (which is always have a text in it to be hide while printing, i heard about font color change to white an all , So, please explain thanks nowfa -- Message posted from http://www.ExcelForum.com Hi as a starting point: http://www.rondebruin.nl/print.htm#Hide -- Regards Frank Kabel Frankfurt, Germany > Hi, > I would like know how to hide certain cell. while printing. example > if C1 is no value i want to hide A1 (which is always have a text in > it) to be hide while print...

API hide access window
I have a question about using the API hide access window module. Thisworks ok for my forms, but the report preview window always getshidden or shows up behind the form. How can I use this module and havethe preview reports in front of the form? I use the code from thewebsite "The Access Web " to show only the active form, but iscumbersome to figure out how to effectively do a report preview andreturn to the previous form.Thanks,PC I haven't tried this so I'm guessing.Have you tried setting the report's Pop-Up property to True?Near as I can tell in order for the main windo...

Permissions on sub-folders
Hi is there a way for sub-folders in,say, Inbox, to inherit permissions. There are about 80 such folders, and the owner wants their secretary to see all of them. Eoin C. Bair�ad Dublin, Ireland ...

Form Web Part
On a webpage there is a Form Web Part for searching through a SQL database. The Form Web Part is linked to a Data View using Web Part Connections. When you enter the search criteria you have to use case sensitive characters. Is it possible to have a case insensitive search Form Web Part? BTW. The SQL db is build case insensitive. -- ���`�.(*�.�(`�.� �.��)�.�*).��`�� �.............. CHARLIE ..............� ���`�.(�.��(�.�* *�.�)`�.�).��`�� ...

Email subform contents from main form
I have visual basic code written in the after update event of a field on the main form. The form has a subform that has 0-10 records & 3 different visible fields. I have the code below written to send an email, which runs successfully. In addition to the current text I would like to be able to include the entire contents of the subform associated with the record in the body of the email. Is this possible to do, or if it is not, would it be possible to include it as an attachment? Thanks! DoCmd.SendObject , , , recep, , , "Parts Shippment", stemailtext & st...

NDRs do not have from field
I get a copy of all NDRs send to me. However, just recently, when I go into the NDR to resend it on, the 'from' field is missing, so I don't know who sent the message. Any idea why this might be and how to change it? The original message should be attached to the NDR. That is what needs to be re-sent, not the NDR itself. NDR's typically have <> as the sender. Do you see the original message attached? -- Ben Winzenz Exchange MVP MessageOne Read my blog! http://winzenz.blogspot.com http://feeds.feedburner.com/winzenz (RSS Feed) "Lata" <jemimas@adp...

Report Writer
I have a client that keeps forgetting to select the custom form size when printing a report in a pre printed form. Is there a way for me to set the properties of the report to choose a specifc form, a default form? Hi Harry Have you checked whether this report is controllable by Named Printers. With Named Printers you can select the printer and all its settings to be used for individual supported reports. David Musgrave [MSFT] Original Developer of Named Printers Senior Development Consultant Escalation Engineer - Great Plains Microsoft Dynamics Support - Asia Pacific Microsoft Dynami...

Error when moving mail recipient from To field to CC field
We have a user that is trying to move an email recipient from the TO field to the CC field in an email by dragging and dropping. When he does this, he gets an error: Microsoft Word. The object is not connected to server. Has anyone seen this? ...