473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Hiding Label and Text Control if the Value is Null II

135 100+
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form _Current()
  2.  
  3.    If IsNull(Me!Legislature) Then
  4.       Me!Legislature.Visible=False
  5.       Me!LabelName.Visible=False
  6.    Else
  7.       Me!Legislature.Visible=True
  8.       Me!LabelName.Visible=True
  9.    End If
  10.  
  11. End Sub
  12.  
Thanks i did some changes but this worked perfectly, however, now i have another issue.

I added the code in the subFORM code and it works, but when i run the REPORT (containing this form) the label IS THERE...ALWAYS!!!

How can this be possible?? if i run directly the subform the label works, it appears and disappears, but when i open the report its always there...

Im using the following code in the subFORM:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.     If Me.RDamortization1.Value > 0 Then
  3.     Me.RDAmortization2label.Visible = True
  4.     Else
  5.     Me.RDAmortization2label.Visible = False
  6.     End If
  7. End Sub
Help,
Gilberto
Sep 19 '07 #1
11 1430
MMcCarthy
14,534 Expert Mod 8TB
To be honest, I've never tried running a subform in a report. The problem may be with the Form_Current event as I'm not sure how this would trigger on a report. You could try putting the following in the Reports OnFormat event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format()
  2.  
  3. If Reports![ReportName]![SubformName].Form![RDamortization1] > 0 Then
  4. Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = True
  5. Else
  6. Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = False
  7. End If
  8.  
  9. End Sub
  10.  
Sep 19 '07 #2
NeoPa
32,556 Expert Mod 16PB
Gilberto,

I think you need to clarify why you would want a subFORM in a REPORT.
I suspect you mean something a little different but you need to be careful to post exactly what you mean, otherwise we only waste time trying to find answers.
Sep 19 '07 #3
Gilberto
135 100+
To be honest, I've never tried running a subform in a report. The problem may be with the Form_Current event as I'm not sure how this would trigger on a report. You could try putting the following in the Reports OnFormat event.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format()
  2.  
  3. If Reports![ReportName]![SubformName].Form![RDamortization1] > 0 Then
  4. Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = True
  5. Else
  6. Reports![ReportName]![SubformName].Form![RDAmortization2label].Visible = False
  7. End If
  8.  
  9. End Sub
  10.  
Im using the subform in the report so that i can print to the clients the calculations to get a product final price. In the form a user enters some parameters (tax, labor work, time required, etc.) and the layout of the calculations are displayed. Is there any other way to do it???

Hello again, im using the following:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3. If Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDamortization1] > 0 Then
  4. Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = True
  5. Else
  6. Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = False
  7. End If
  8.  
  9. End Sub
but i get the error: 2465 saying that it CANT find the FIELD 'SUBPricingL1V1'

As it mentioned FIELD i deleted the FROM part from the equation (If Reports![Pricing L1V1]![RDamortization1] > 0 Then..... BUT im still getting the same error.

Any ideas...Thanks again,
Gilberto
Sep 19 '07 #4
NeoPa
32,556 Expert Mod 16PB
You have asked your question in another member's thread. This is called thread hijacking and is not allowed on this site. There are various reasons for this, the principal of which is that it typically diverts the flow of the thread away from his needs and into yours. Another is that it will tend to mean that your new question is not seen as such, and may get overlooked by many of our experts (You appreciate that they're not looking for answered questions).
Please post your questions in their own threads in future (See How to Ask a Question).

MODERATOR.
Sep 19 '07 #5
Gilberto
135 100+
You have asked your question in another member's thread. This is called thread hijacking and is not allowed on this site. There are various reasons for this, the principal of which is that it typically diverts the flow of the thread away from his needs and into yours. Another is that it will tend to mean that your new question is not seen as such, and may get overlooked by many of our experts (You appreciate that they're not looking for answered questions).
Please post your questions in their own threads in future (See How to Ask a Question).

MODERATOR.
Sorry about this, im new in here and i didnt notice. I will continue with the question under my own thread.

Gilberto
Sep 19 '07 #6
NeoPa
32,556 Expert Mod 16PB
Sorry about this, im new in here and i didnt notice. I will continue with the question under my own thread.

Gilberto
That's a fine attitude Gilberto and we do appreciate that some new members make mistakes. This is not a problem but we still need to keep on top of it :)

In this case, you needn't create a new thread as I've already split this part away from the old one for you.

PS. I replied earlier in the thread before I realised it was a hijack so check out that post and let us know how you'd like to proceed.
Sep 19 '07 #7
Gilberto
135 100+
That's a fine attitude Gilberto and we do appreciate that some new members make mistakes. This is not a problem but we still need to keep on top of it :)

In this case, you needn't create a new thread as I've already split this part away from the old one for you.

PS. I replied earlier in the thread before I realised it was a hijack so check out that post and let us know how you'd like to proceed.
Thanks. I think i replied to your post already and also posted my current situation at my own thread ("Dissapear a report textbox IF no information or "0") which i created a few days ago. If you could continue helping me there (or here hehe) i would really appreciate it.

Gilberto.
Sep 20 '07 #8
NeoPa
32,556 Expert Mod 16PB
Gilberto,

I looked through your posts but there was none that I could find which was a response to my post #3.
I also looked through your recent threads (a number) but again, could find none that remotely matched the title you've quoted.

I'm happy to continue to help where I can but I will wait for a response if I post a suggestion.
If you can point me to the thread you asked the question in I will tidy things up so that all future posts appear in just that thread.
Sep 20 '07 #9
Gilberto
135 100+
Gilberto,

I looked through your posts but there was none that I could find which was a response to my post #3.
I also looked through your recent threads (a number) but again, could find none that remotely matched the title you've quoted.

I'm happy to continue to help where I can but I will wait for a response if I post a suggestion.
If you can point me to the thread you asked the question in I will tidy things up so that all future posts appear in just that thread.
Sorry again...confusion here...

I replied to your #3 post on the other thread. So here it is with my current situation.

Im using the subform in the report so that i can print to the clients the calculations to get a product final price. In the form a user enters some parameters (tax, labor work, time required, etc.) and the layout of the calculations are displayed. Is there any other way to do it???

Right now im using the following:


Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3. If Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDamortization1] > 0 Then
  4. Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = True
  5. Else
  6. Reports![Pricing L1V1]![SUBPricingL1V1].Form![RDAmortization2label].Visible = False
  7. End If
  8.  
  9. End Sub
  10.  
but i get the error: 2465 saying that it CANT find the FIELD 'SUBPricingL1V1'

As it mentioned FIELD i deleted the FROM part from the equation (If Reports![Pricing L1V1]![RDamortization1] > 0 Then..... BUT im still getting the same error.

Any ideas...Thanks again,
Gilberto
Sep 20 '07 #10
NeoPa
32,556 Expert Mod 16PB
OK.
Let's try to organise some order out of the chaos before we attempt to proceed.
  1. Your answer unfortunately is not a meaningful answer to the question (I'm still confused as to why you are trying to connect forms with reports).
  2. Please post a copy / pasted version of the title of the other thread in here so that I can find it and tidy things up a little (We will probably close this thread and continue from there. I can't do that if I can't find it.).
Subforms go on forms and subreports go on reports. A subform on a report leaves no-one knowing what you're talking about and so no-one able to help.

All this is because you don't take enough care in what you do. You are rushing from one thing to another when you need to stop and concentrate on doing one thing at a time - and that properly.
Sep 20 '07 #11
Gilberto
135 100+
OK.
Let's try to organise some order out of the chaos before we attempt to proceed.
  1. Your answer unfortunately is not a meaningful answer to the question (I'm still confused as to why you are trying to connect forms with reports).
  2. Please post a copy / pasted version of the title of the other thread in here so that I can find it and tidy things up a little (We will probably close this thread and continue from there. I can't do that if I can't find it.).
Subforms go on forms and subreports go on reports. A subform on a report leaves no-one knowing what you're talking about and so no-one able to help.

All this is because you don't take enough care in what you do. You are rushing from one thing to another when you need to stop and concentrate on doing one thing at a time - and that properly.
Hello again,

The other thread is "Dissapear a report textbox IF no information or "0" ". Just to try to clarify...I created a form with some textboxes the user has to enter (#units, cost, taxes, etc etc), some calculations and the results of the calculations conbined with the users information. The display of the form is too big and with colors so in order to print this in the format i wanted i created a subform which only DISPLAYS the information and calculations and i entered this (i dont know its proper name...i guess its a subreport, as it IS contained IN a report).

Thats my current situation. Apart from that. My ONLY issue is that when i open that subform on its own, if "amortization" equals zero, that text box "disappears" which is what i want. BUT when i open the REPORT (where THAT EXACT form is entered) it seems that the code to disappear the text doesnt work, as it ALWAYS appears.

I hope this is better.
Thanks again, and i agree that trying to multitask while being new with this is NOT a good idea, i will try to finish up with one thing before going to the next one.
Sep 20 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: luvdairish | last post by:
Can someone please look at my code and see why tables are not hiding properly? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Untitled Document</TITLE> <META...
3
by: sloan | last post by:
<asp:BoundField DataField="MyDate" DataFormatString="{0:d}" HeaderText="My Date" /> I have a BoundField being populuated with the "MyDate" column. The MyDate is in a strongly typed DataSet. The...
2
by: sephali | last post by:
Hello sir, I want to hide the label and text box control which is of null value. The name of the FORM is "Index Entries". The Field name of that text box is the "Legislature". For this I have...
2
by: Andy B | last post by:
I have the following listView control on a page: <asp:ListView ID="ListView1" runat="server" ItemPlaceholderID="PlaceHolder1"> <ItemTemplate> <dl> <dt>
0
by: bharathreddy | last post by:
Hi All, I am using a listview control in my usercontrol so that it can be used in more than one form. This user control has one column extraw, so i want to make it invisible depending on the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.