473,326 Members | 2,182 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.

change the form based on options button

Is there a way to change the appearance of my form based on which option button is selected? I am using a form to input data into a table of transactions. There are basically 3 types of transactions (the type of which I would specify with an options button) and, though they all share common fields, some entries do not require all of the fields to be populated. For these I'd like for some of the combo boxes (my form uses combo boxes exclusively for data input) to not be visible. Is this sort of thing feasible or would I be better off just using Tab Controls? (Though I don't really want to take that option). I am using Access 2003.
Oct 9 '07 #1
4 2445
nico5038
3,080 Expert 2GB
You can use the AfterUpdate event of the Frame holding the options to code a SELECT CASE like:
Expand|Select|Wrap|Line Numbers
  1. SELECT CASE fraOptions
  2. Case 1
  3.    Me.cmb1.visible = true
  4.    Me.cmb2.visible = false
  5. Case 2
  6.    Me.cmb1.visible = false
  7.    Me.cmb2.visible = true
  8. end select
  9.  
This will require all the fields to be set to true or false !

The tab control can be used and the buttons can be hidden.
Then the fields can be placed on three tabs and the correct tab can be activeted in the same AfterUpdate event by using the fraOptions value like:
Expand|Select|Wrap|Line Numbers
  1. Me.tabctl1.Pages(fraOptions).setfocus
  2.  
Getting the idea ?

Nic;o)
Oct 9 '07 #2
I'll have a look. Thanks. As a beginner, though, it may be a bit over my head.
Oct 10 '07 #3
nico5038
3,080 Expert 2GB
Then I would probably just use a tabcontrol and place the "specific" values per page.
The code I posted needs to be placed in events for the form. Looks "freightning", but is rather "easy".
To start you could define a new button with the button wizard, e.g. for opening another form, then you can inspect the created code by Access by clicking on the [...] button after the Procedure for the OnClick event in the properties window.

Nic;o)
Oct 10 '07 #4
NeoPa
32,556 Expert Mod 16PB
I'll have a look. Thanks. As a beginner, though, it may be a bit over my head.
Nico's first solution in post #2 (Select Case ...) should precisely meet your requirements. It looks complicated first time but give it a go. We can always help some more if you don't understand it all clearly first time through.
What it's basically doing is showing or hiding ALL of your variable fields (those which are sometimes shown but sometimes hidden) depending on the selection of your option buttons (The fraOptions control there is referring to the Frame that the radio buttons are in. It's value will always reflect which button is selected).
Oct 12 '07 #5

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

Similar topics

2
by: Laurent Bertin | last post by:
Hi i got a strange problem but it's true i don't make thing like anyone... First Config: + IIS5.0 SP2 (yes i know...) WebSite Security Root : Digest Authentication, NT Authenticated SubFolders...
2
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
3
by: RC | last post by:
I can't quite grasp the concept of creating custom reports depending upon what options a user picks on a Form. For example, the user clicks on a "Print Reports" button and a Form pops up. On the...
1
by: news.wanadoo.nl | last post by:
Hi, I have found whit google this form in this group. But i'n not good in javascript :(. I try and error normal but i only error now :P Whit i now want to now how can i get access to the vars...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
11
by: free4trample | last post by:
First of all let me say that I know very little about javascript. what i need to do is to write a javascript functin which will change the background color of the table rows based on entrees in...
6
by: Arthur | last post by:
Hello. How might it be possible to change where a form action is directed based on a selected option. For example I have this: <FORM METHOD = "post" ACTION = ""> And a drop down such as
3
by: uniqueabc | last post by:
hi all, I have to develope a form which has mutiple choice (radio buttons) on the top and based on the button selected the entries for the form changes dynamicallyat the bottom. can anybody plz...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
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: 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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.