Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / October 2006

Tip: Looking for answers? Try searching our database.

How do i change the check box value in a form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
xneiax - 12 Oct 2006 07:24 GMT
Say I have created a form. One of the headings read "Type of Damage" and I
have 2 optons to select for that. Option 1 - "Struck" and Option "Damage".

How do I format it:-

1. so some one can only select ONE of the options.
2. When selected, the word (eg. "Struck") is saved in my table instead of a
-1?

Thanks in advance.
Damian S - 12 Oct 2006 07:53 GMT
Hi xneiax,

Use an Option Group with two Options - Struck and Damage.  Use the wizard to
create the Option Group, with the option "I want to save the choice to use
later".

On your form, put a hidden text field for the item you are wanting to record
in your database, then have some code behind the On Click event for you
Option Group like this:

select case optgrpChoice
 case 1
   ' Struck
   me.txtDamageType = "Struck"

 case 2
   ' Damage
   me.txtDamageType = "Damage"

 case else
   ' Shouldn't be able to get here
   msgbox "not sure how we got here"

end select

Of course, I personally would question why you would want to record the text
in your database rather than creating a lookup list of Damage Types and
linking to that list, that way you can use a Combo Box for people to select
an item, and if you ever decide that "Struck" is now to be known as
"Impacted" you can just change it in the lookup table and that will fix it up
for all your records.

Hope this helps!!

Damian.

> Say I have created a form. One of the headings read "Type of Damage" and I
> have 2 optons to select for that. Option 1 - "Struck" and Option "Damage".
[quoted text clipped - 6 lines]
>
> Thanks in advance.
xneiax - 12 Oct 2006 08:12 GMT
Thanks! I'll try the other alternative too.

> Hi xneiax,
>
[quoted text clipped - 42 lines]
> >
> > Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.