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

Unbound Button Group

166 100+
Hello:

I am trying to set up unbound button group options to allow the user to select the value they would like to use on another form.

In the process, the user has run several tests and he needs to decide which test results he will use. He will run at least one test and up to 10. My idea was the have the buttons (1-10) each representing a test ran. If for instance the user selects test 3 out of 7 tests, then he would select button 7 and the information pertaining to that test would populate on the next form.

I have a query that returns the results for each each test in the group, but I am unsure how to make it work in conjunction with the buttons. I was thinking that I would need to code each button with an onclick event or maybe have one case statement. as I said my buttons are in a group, so could i have one case statement that corresponds to each button in the group? If this is how i can accomplish it, how do I set the buttons in VBA to correspond to the entries of the query?

Thank you!
Jan 26 '09 #1
3 2142
ChipR
1,287 Expert 1GB
If you click on the actual buttons in design view, you can see their value under the Data tab -> Option Value. You could make your case statement like
Expand|Select|Wrap|Line Numbers
  1. Dim strWhere as String
  2.  
  3. Select Case OptionGroup  'the name of the whole Option Group
  4.     Case 1  'Note on which button this is
  5.         strWhere = "Test = 1"
  6.     Case 2  'Note on which button this is
  7.         strWhere = "Test = 2"
  8.     Case Else
  9.         MsgBox "Invalid Selection!"
  10.         Exit Sub
  11. End Select
  12.  
  13. DoCmd.OpenForm "The Other Form", , , strWhere
That is an example to set a filter for the form you open depending on the selection. You could use open arguments, or just open a whole different form in each Case if you wanted to.
Jan 26 '09 #2
csolomon
166 100+
My plan is for each button to correspond to a row in the query and for instance if you click option 2, the form will open with all of the information related to selection 2

Is this possible?

Thanks
Jan 26 '09 #3
ChipR
1,287 Expert 1GB
If your form is based on the query, then the code that I have given you is exactly what you want. It opens the form with it filtered to the record that you specify according to the option selected. If you need more help, you can post the query that the form is based on, and the criteria you will use to select a row in the query.
Jan 26 '09 #4

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

Similar topics

1
by: InDeSkize | last post by:
Hello my programming Super Heroes. I think this one is a no brainer, me being the one with no brain. I have a form that is used for data entry. The goal is to have an unbound form that only...
20
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of...
1
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform....
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
2
by: NerdyGirL | last post by:
Hello, I've read thru numerous post/archives trying to decipher the cause of my problem to no avail. I'm just basically trying to conduct a search by using a form in order to locate data that may...
2
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
7
by: DeZZar | last post by:
Hi all, Unfortunately I am quite a novice with Access!! I've created a number of data bases for my work however becuase my skills are limited to really built in functionality and wizards my...
7
by: troy_lee | last post by:
I have an unbound form. I have an Add New procedure that saves a new record to the database. What is the best way to update an existing record? In other words, clicking my "Submit record" button...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.