|
-
Jun 7th, 2007, 01:01 PM
#1
Thread Starter
Junior Member
option buttons connected to other stuff
I made a form in Access and am trying to set it up so that in one section you can choose from a list of past contacts, and if the contact isnt on that list, then you can enter in the name and adress of the new contact. So i made an option button group to select if the contact is on the list or if you are entering a new one, a drop down box that contains the past contacts, and some other text boxes so you can enter the new contact, but i have no idea how to make them all work together. Any help would be greatly appreciated
Last edited by obertseph; Jun 7th, 2007 at 01:15 PM.
-
Jun 7th, 2007, 01:30 PM
#2
Hyperactive Member
Re: option buttons connected to other stuff
Option buttons must be placed in a frame for them to work together...
to tell which one the user has chosen is basically going to be a bunch of conditionals...
if OptionButton1.checked = true then
do something
elseif OptionButton2.checked = true then
-
Jun 7th, 2007, 02:04 PM
#3
Thread Starter
Junior Member
Re: option buttons connected to other stuff
ok, but what VB code would i write so that my form uses the information in the drop down box over the information in the new contact text boxes, and vice versa
-
Jun 7th, 2007, 06:30 PM
#4
Hyperactive Member
Re: option buttons connected to other stuff
Not quite sure what you are trying to accomplish... Could you try explaining how these are all related again?
-
Jun 8th, 2007, 08:52 AM
#5
Thread Starter
Junior Member
Re: option buttons connected to other stuff
I have a form for people to enter new data into a database. Each new data entry contains a contact. I want to make it so they can choose a contact from a list of past contacts, or enter new information if their contact isnt in the database already. So i have it set up that there is an option button where you can choose to either pick a contact from the ones already in the database, via a dropdown box, and the other option button in my option group would be connected to an area where they can enter new contact information. Or at least thats what i hope to achieve. If you have any idea how to go about doing this, or an easier way i would greatly appreciate it.
-
Jun 8th, 2007, 09:57 AM
#6
Hyperactive Member
Re: option buttons connected to other stuff
Option button could work, but I think it might be easier to just have two command buttons. One button next to the dropdown box, saying "Select contact from dropdown" and one button next to the text box, saying "Select custom contact" or something like that ...
But if you want to stick to your option button here's some pseudocode...
Code:
if optDropDown.selected = True Then
'check to make sure an item in list is selected
'assign that value
else 'they are entering new information
'make sure valid entry
'assign that value
hope this helps
-
Jun 8th, 2007, 10:47 AM
#7
Thread Starter
Junior Member
Re: option buttons connected to other stuff
i'm really lost when it comes to using visual basic. How can i make it so that it will take the values from my drop down list, and put them in my table as an entry.
-
Jun 8th, 2007, 11:00 AM
#8
Re: option buttons connected to other stuff
In Access on an Access Form:
Create a frame control
Rename the fram control to 'frmChoice'
Drag n drop in two option buttons
Change the text of the option buttons
Set the frames default value to 1
Code:
select case fraChoice
case 1
'---- use old details from list
case 2
'---- code to use the new details
end select
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 8th, 2007, 11:52 AM
#9
Thread Starter
Junior Member
Re: option buttons connected to other stuff
ok, but what is the code to tell it to use those details from the list, thats what I cant figure out, my MS Access book doesnt talk about code that can do that.
-
Jun 8th, 2007, 11:56 AM
#10
Hyperactive Member
Re: option buttons connected to other stuff
-
Jun 8th, 2007, 12:28 PM
#11
Thread Starter
Junior Member
Re: option buttons connected to other stuff
nevermind, i am just going to use an alternative technique
Last edited by obertseph; Jun 12th, 2007 at 07:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|