473,397 Members | 1,969 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,397 software developers and data experts.

Hide textboxes with no records and move/shift left visible txtboxes on a form

Hello, everyone!

I have a search form with 12 checkboxes (= 12 months), and another form which displays the search results. On the display form, I'd love to display only the months that have been ticked on the search form and hide the others.

Now comes the questions of layout - how can I move/shift the visible textboxes so that there're no holes/blank spaces on the display form?

Here's the code snippet of what I've got so far, but there's an error there:

Expand|Select|Wrap|Line Numbers
  1. If Me("ck" & i).Value Then
  2.              Forms!FrmAusgabe_Monat("txt" & i).Visible = True
  3.     Else
  4.             Forms("FrmAusgabe_Monat").Controls("txt" & i).Visible = False
  5.  
  6.     End If
  7.  
Any suggestions? I'm getting really desperate here!!!

Thanks a lot in advance,
OfficeDummy
Mar 10 '08 #1
1 1322
JustJim
407 Expert 256MB
Hello, everyone!

I have a search form with 12 checkboxes (= 12 months), and another form which displays the search results. On the display form, I'd love to display only the months that have been ticked on the search form and hide the others.

Now comes the questions of layout - how can I move/shift the visible textboxes so that there're no holes/blank spaces on the display form?

Here's the code snippet of what I've got so far, but there's an error there:

Expand|Select|Wrap|Line Numbers
  1. If Me("ck" & i).Value Then
  2.              Forms!FrmAusgabe_Monat("txt" & i).Visible = True
  3.     Else
  4.             Forms("FrmAusgabe_Monat").Controls("txt" & i).Visible = False
  5.  
  6.     End If
  7.  
Any suggestions? I'm getting really desperate here!!!

Thanks a lot in advance,
OfficeDummy
Hi,
A quick and dirty method would be just to have one (wide) textbox and set it's value to a concatenated series of values with lots of IIF statements.

Warning: Air Code follows
TextBox.Value = Iif(chkJan,JanValue,"") & " " & Iif(chkFeb,FebValue,"") & ..... etc

Jim
PS this would give a leading space characher if chkJan were false, two leading spaces if chkJan and chkFeb were both false, etc. It could be worked though.
Mar 20 '08 #2

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

Similar topics

9
by: sergio | last post by:
Hi all, I have created the following script that will show/hide a menu based on checkboxes. It works fine in Opera but not on IE6! Does anybody knows a workaround this problem? Thanks for your...
2
by: Danny | last post by:
How to allow users to select a set of records and then let them change a field for all these records at once? I would like to do this in code on a form. I will have a form with tabular view of...
4
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost...
3
by: meska | last post by:
Is there a way in c# to hide program , that it would show in alt+tab ?
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
3
by: Merlin | last post by:
Hi there, I am trying to create a form with an dynamic field that can be shown or hidden. As I saw for example on google it is possible with JS to show a layer and move the content underneath...
0
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
1
by: magmike | last post by:
Looking to do sort of the same thing you see on websites, but on access form, where when a value is selected from a drop down list, if it matches the desired value, certain form fields appear. ...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.