Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to make text boxes visible/not visible

Status
Not open for further replies.

Patentinv

Technical User
Aug 26, 2005
84
US
Hello,
In my program I have the text boxes in the form header set for invisible or visible = no, then on the combo boxes I have an on click event procedure that makes the text boxes visible. Each combo box relates to a specific text box. You’ll understand why as you read on.

Now when I close my program or if I filter to a new record the text boxes go back to invisible. Is there any way to make my program show these text boxes visible like they were before I exited the form, when I re-open it to the same record?

Here's are more details:
The text boxes are not bound to fields they have a control source of another text box that has a calculation in it.
I've provided a print screen of my program:

Notice all the text boxes in form header are not visible except for the 30 yr comp and 50 yr comp, also notice under roof types on the form body these are the only chosen roof types, also notice below these is the text box that shows the same value as on the form header, this is one of the text boxes that’s in the control source of the text boxes in the form header.

I was hoping if I was to exit this form and then reopen it to same record I could make it open just like the print screen shows, just like it was when I exited it. With out all the text boxes going back to invisible.

I’ve been reading trying to learn SQL here’s what I’ve been trying to accomplish,
Please excuse the sloppy syntax, I’m a beginner.

My 1st SQL statement (Place this in the form event procedure on open (I'm thinking))

Select: 25yrcomp, 30yrcomp, 40yrcomp, 50yrcomp, lifecomp, litetile, concretetile1, shake, torchon
(these are the combo boxes control source fields in the PrimaryBid_Master table)

From: PrimaryBid_Master table

Where: ( If cbocs = 0 Then
txcs = Not Visible)
Else cbocs = Not (<>) 0 Then
txcs = Visible

In other words: if the roof type has not been chosen the combo boxes bound fields will show 0 so keep the text boxes that relates to this combo box in the form header invisible other wise if the combo box has been chosen they will show not 0, they’ll show what ever value is in the combo box options they chose so make the text boxes in the form header that relate to this chose visible.


I think I need to declare the combo boxes control sources as
Set cbocs= Me.30yrcomp, Me. 40yrcomp, Me.50yrcomp, Me.lifecomp, Me.litetile, Me.concretetile1, Me.shake, Me.torchon

I think I need to declare the text boxes control sources as
Set txcs= Me.mat25yr, Me.mat30yr, Me.mat40yr, Me.mat50yr, Me.matLifecomp,
Me.matmedshk, Me.mathvyshk, Me.matflatltile, Me.matconrttile, Me.mattorchon


Thanks--any suggestions will be very appreciated
 
Hello, I don't believe this query will accomplish this task because all the other text boxes in the form header will still remain invisible.
I need to move the calculation out of the text boxes in the form header and have a bound field to each text box so I can query these fields not the combo boxes bound fields.

Sorry I should of thought of this before posting this thread.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top