Showing posts with label textbox. Show all posts
Showing posts with label textbox. Show all posts

Wednesday, March 21, 2012

How do I hide zeros w/o a conditional stmt

I need a way to format fields without having to write a conditional statement
based on each textbox's value. I'm dealing with hundreds of fields.
Something like a HideZeros setting on the field. Any help would be
appreciatedWhat I do is change the Format property of each textbox to a custom value:
#,##0.0;(#,##0.0);-
the 1st group is how to display positive values;
the 2nd is for negatives;
and the 3rd is for zeroes (I am just displaying a dash here).
good luck,
Greg
"Blake Gremillion" <BlakeGremillion@.discussions.microsoft.com> wrote in
message news:64AAF2A7-F92B-4E91-8F96-3A9AAB2088FC@.microsoft.com...
>I need a way to format fields without having to write a conditional
>statement
> based on each textbox's value. I'm dealing with hundreds of fields.
> Something like a HideZeros setting on the field. Any help would be
> appreciated|||Thanks!
Worked great. Any idea on how to use that with a Percentage field.
"Blake Gremillion" wrote:
> I need a way to format fields without having to write a conditional statement
> based on each textbox's value. I'm dealing with hundreds of fields.
> Something like a HideZeros setting on the field. Any help would be
> appreciated|||I would try custom again and this time use:
0.0%;(0.0%);-
I pesonally use custom with percentages anyways and use
P1
to get just one decimal place. I think the standard "percentage" option,
gives you two. Of course neither hides zeroes. ;(
Greg
"Blake Gremillion" <BlakeGremillion@.discussions.microsoft.com> wrote in
message news:0B62BEDB-123A-4B5A-B363-ACAF9759425C@.microsoft.com...
> Thanks!
> Worked great. Any idea on how to use that with a Percentage field.
>
>
> "Blake Gremillion" wrote:
>> I need a way to format fields without having to write a conditional
>> statement
>> based on each textbox's value. I'm dealing with hundreds of fields.
>> Something like a HideZeros setting on the field. Any help would be
>> appreciated|||Yeah, I think that's what I'll have to do instead of using the Px format.
Thanks Again!
"Greg Burns" wrote:
> I would try custom again and this time use:
> 0.0%;(0.0%);-
> I pesonally use custom with percentages anyways and use
> P1
> to get just one decimal place. I think the standard "percentage" option,
> gives you two. Of course neither hides zeroes. ;(
> Greg
>
> "Blake Gremillion" <BlakeGremillion@.discussions.microsoft.com> wrote in
> message news:0B62BEDB-123A-4B5A-B363-ACAF9759425C@.microsoft.com...
> > Thanks!
> >
> > Worked great. Any idea on how to use that with a Percentage field.
> >
> >
> >
> >
> > "Blake Gremillion" wrote:
> >
> >> I need a way to format fields without having to write a conditional
> >> statement
> >> based on each textbox's value. I'm dealing with hundreds of fields.
> >> Something like a HideZeros setting on the field. Any help would be
> >> appreciated
>
>

How do I get the SqlDataSource to look at the textbox

I am working with a Detailsview. I am displaying information from a number of different tables, and so when I configure the datasource I have to specify a custom sql statement. I can get it to display the right columns, but I cannot seem to be able to use a where statement.

I am wanting to display the info in the Detailsview based on what is entered into a textbox, but I get an error when I try to add in the where statement. Can someone tell me what I am missing here?

Thanks

Just add WHEREsomefield=@.textboxvalue in your SQL Query. Then (if in VS 2005), hit the refresh parameters button, and choose where to pull @.textboxvalue from (Parameter type would be control, and the ControlID would be Textbox1).|||

Thanks. It was the @. that I was missing.

|||Binding an SQL WHERE clause to a free-text field to return just one record sounds to me rather dodgy, as it indicates that the database design could be poor. Normally a DetailsView is used as part of a master-detail design and should be bound to the primary key of the master table.

Monday, March 12, 2012

How do I get CanGrow to work for a textbox in a table?

I have a very basic table that I want to use as a subreport. It has only one row and one column, and it's textbox value is:

Fields!VendorType.Value & ": " & Fields!VendorName.Value & " " & Fields!VendorContactName.Value & IIF(Fields!VendorPhone.Value > " "," " & Fields!VendorPhone.Value,"")

The Data uses a parameter from the parent report to get the values, and there are usually several vendors for each report. The textbox in the row has it's 'CanGrow' property set to Yes, because sometimes these values are too long for one line. But when I run the report, it does not grow. it just truncates the value.

Any ideas? what can I do?

If you just render the table as a stand-alone report, do the textboxes grow? Which renderer are you using? Remember textboxes can only be grown vertically, not horizontally.|||

Well, I was working up some examples for you when I realized that I was not getting the data I thought I was. So, it is working. Sorry! But thanks.

Sunday, February 19, 2012

How do I display SQL info. in a VB textbox?

I need to find out how to display, edit and save SQL information using Visual Basic. I can create an SQL database and spreadsheet, but do not know how to incroporate it into my project, and make certain pieces of the information (certain cells) appear in the labels or textboxes that I designate in my VB Project.

Thanks.

You should check out the information in the VB.NET help files. Take a look at the topics at http://msdn2.microsoft.com/en-us/vbasic/ms789183.aspx and the help files at http://msdn2.microsoft.com/en-us/library/zh26sed6(VS.80).aspx.

Mike

|||

I don't understand what the links show.

This problem is also related to MSDN Forums>SQL Server>SQL Express>How can VB look something up in an SQL Table?