473,326 Members | 2,438 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,326 software developers and data experts.

Conditionally format control location

Hello, and thanks in advance for helping me out. I have a form which filters data in numerous ways. I have set up the form such that Access will only filter a given category if a checkbox next to the control name is checked. Under several categories of data, there are several other options, each with a check box associated with them. I am able to display only the results I want by clicking the check box, but am having difficulty moving the sub-search values to different locations on the form.

An example: searching for a car.

[check_box_make] 'makes the next three boxes visible when checked
[check_box_Chrysler]
[check_box_Lexus]
[check_box_Subaru]

[check_box_seats] 'makes the next 4 boxes visible when checked
[check_box_2]
[check_box_4]
[check_box_5]
[check_box_7]

The goal is to shift the seats check boxes down a specified distance if [check_box_make] is checked. The purpose of this is in my actual form I have so many fields that the user would have to scroll through a bunch of them to get at the categories he/she wants to use.

When I try to set the Format -> "Top" property in VBA, it moves the object to the top of the form (.0007"). My code looks like this:

Expand|Select|Wrap|Line Numbers
  1. Dim startpoint as int
  2. startpoint = .4
  3. If [Forms]![frmFrontEnd]![check1].Value <> Yes Then
  4.     [Forms]![frmFrontEnd]![check1].Top = startpoint + 0.5
  5. End If
Any help you can offer would be greatly appreciated!

(PS: the reason I'm not just using combo boxes is because the user will often need to use multiple values in each category.)
Jan 14 '08 #1
4 1507
NeoPa
32,556 Expert Mod 16PB
This is because you are trying to add values in cm (or whatever unit you use) instead of in Twips (1 / 567 cm). In the user interface, the values are converted to and from twips for you. When you use a cm value for twips, the value is so low it looks as if it's zero.
Jan 15 '08 #2
NeoPa
32,556 Expert Mod 16PB
Tip :
Use the current value of Top & Left to vary from where possible. That way there is less code to maintain.

BTW This will work for you. I use it a fair bit and it's fun :)
Jan 15 '08 #3
Fantastic! Thanks for the help! Its nice of access to let you know that its not going to use the number you give it. Its almost as annoying as it "helpfully" popping up an error message when I leave code as "yadda_yadda = [" then try to click somewhere else in the code to copy a control. In any case, thank you very much for your help!
Jan 16 '08 #4
NeoPa
32,556 Expert Mod 16PB
Not a problem Nick. I hope you enjoy playing as I did ;)

To be fair to Access though, it is explained (possibly less clearly) in the Help file that the properties are stored in twips.
Jan 17 '08 #5

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

Similar topics

7
by: Tom Petersen | last post by:
I must have the format of the below line wrong for IE: click <a href="cal.asp?sdate=<% =strDate1 %>&location=<% =strLocation %>&eTime=<% =strDate2 %>">here</a> to add this information to your...
2
by: Olav Tollefsen | last post by:
I'm creating an ASP.NET e-commerce web site and I have to conditionally (depending on site / user settings) display prices either excluding or including tax. Prices are typically read from a...
2
by: Paul | last post by:
Just wondering if anyone knows how to conditionally load a user control on a page? In other words load the user control if the page is reached with one link and do not load it if it is reached by...
2
by: Jens Weiermann | last post by:
Hi, I need to conditionally disable a html (not web forms) button control. The condition is to be evaluated server-side. What is the smartest way to do this? I'm now using a literal server-side...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
0
by: sehguh | last post by:
Hiya Folks, I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005. The main page consists of an aspx page and a master page. The page also...
3
by: Naushad | last post by:
Hi All, I am trying to open the report conditionally from the dialogue box form. In the form there are three field. cboEmployees StartDate EndDate I have used these field in criteria to...
4
by: =?Utf-8?B?ZGNoMw==?= | last post by:
Is there a way to conditionally format a dateTime field to produce on result if the value is 10/31/2008 12:00 AM (user didn't enter a time) and another result if the value is 10/31/2008 5:30 PM...
4
by: =?Utf-8?B?Y2xhcmE=?= | last post by:
Hi all, It may sound esoteric, but actually it is. Let's say there is a string resource in a project, the value is "AA BB". How can I only format the "BB" part into bold type. Can I finish the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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: 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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.