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

Access 2003 - forms and radio buttons

Hey all,

i am trying to do the following and am having problems, if there is anyway you can guide me or even point me to some material that may help it would be great.

I have created a form in access that allows users to input data and save record, the form is used for logging system faults when users call in.

when a uiser calls the operator will answer call and place the username in field1 (combo box) this autopopulates all the other text boxes.

the underlying data is a users table which has username and whether the user is active or inactive.

what i need help in is -


1) i have 2 fields field1 and field2, when i start to input a username into field1 i want field2 to show all usernames that have the same wording/text in their username untill a point i select one. (both fields will reference the same users table)

2) on my users table their are 2 types of users 1) active and 2) Inactive i have 3 radio buttons that i want users to select to say whether they want to search the 1) active users or 2) inactive users or 3) All users for the username they are about to enter in field1

Any support would be much appreciated

Look forward to hearing from you.
Oct 6 '09 #1
4 4285
ChipR
1,287 Expert 1GB
It's hard to match the ease with which the combo box autocomplete works. If you want to be able to search in the middle of the field though, I'm assuming field2 is a list box or something. You would use the Change() event of field1 (text box) to change the source of field2 based on the current value in field1 every time a letter changed.
I would use a select case statement to form the criteria of the SQL based on the radio button selected. This should give you some idea what I mean, but it's not tested code.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtField1_Change()
  2.  
  3.   strSQL = "Select * FROM Users WHERE " _
  4.    & "UserName LIKE ""*" & txtField1.Text & "*"""
  5.  
  6.   Select Case radioGroup
  7.     Case 1
  8.       strSQL = strSQL & " And Status = ""Active"""
  9.     Case 2
  10.       strSQL = strSQL & " And Status = ""Inactive"""
  11.     Case 3
  12.       'strSQL = strSQL & ""
  13.     Case Default
  14.       MsgBox "You messed something up!"
  15.   End Select
  16.  
  17.   lstField2.RowSource = strSQL
Oct 6 '09 #2
Hey ChipR,

Tried following your outline above and i keep getting case default, not sure if its me or the code!

If it helps i can list out the names of each object (not sure if it will)

Combobox to insert username in = cbonames
Radio button for active users = Active
radio button for Inactive users = Inactive
Radio button for all users = All

on my users table the column for status is called "status" and the values are "active or Inactive"

when i apply a similar code to what you have provided the case default keeps coming up and each time box change error message appears. (due to sub being on change)

Sorry to annoy you.
Oct 7 '09 #3
ChipR
1,287 Expert 1GB
You'll want to look at the radio buttons' properties and check the Option Value. This is what you'll compare to in your Select Case.
Oct 7 '09 #4
NeoPa
32,556 Expert Mod 16PB
Thread hijack moved to Radio Button Problem.
Oct 8 '09 #5

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

Similar topics

5
by: PhiSYS | last post by:
I want to know what's wrong with this code (I'm an amateur programmer). I'm trying to check if every field has a value or if checkboxes/radios have at least one item checked on each group (yes, you...
11
by: Jon Hoowes | last post by:
Hi, I have inherited some code that has some form elements (radio buttons) that are called "1", "2" etc. for example: <input name="2" type="radio" value="45"> <input name="2" type="radio"...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
3
by: rob c | last post by:
Hi I'm not sure if this is the right place to ask for help on forms and radio buttons... In the following form, I'd like to set the value of 'item_name' based on which radio button was...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
2
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use...
4
by: Z.K. | last post by:
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") ...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
6
by: Zetten | last post by:
This is going to be a long one, but hopefully that will make it easier to understand. I know I don't like posts with too little detail when I'm searching for help. I am creating a form with which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.