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 / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

check boxes, eye dots ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
colleen medin - 24 Feb 2005 23:53 GMT
Ref: office xp sp3

Would like to put up on the screen a window with several check box's or ...
. The user would then mark the boxes appropriate to his request & then click
on next or ... . Then the vba program could process the request(s).

Seems access has this capability but I cant find it. TIA
Ken Snell [MVP] - 25 Feb 2005 00:15 GMT
Not sure what you cannot find? ACCESS has checkbox control, radio button
control, and toggle button control. Any of these could work for your
purposes. They can be used within an option group (which means only one can
be selected at a time) or as standalone controls (which means that any
number of them can be selected at one time).

VBA code would read the controls' values and do something with them. This is
pretty common stuff for ACCESS.

Signature

       Ken Snell
<MS ACCESS MVP>

> Ref: office xp sp3
>
[quoted text clipped - 3 lines]
>
> Seems access has this capability but I cant find it. TIA
colleen medin - 27 Feb 2005 16:01 GMT
We currently have buttons in forms. We click on a button & a vba program
gets control. So what is the step/steps to get to checkbox control ... . TIA

> Not sure what you cannot find? ACCESS has checkbox control, radio button
> control, and toggle button control. Any of these could work for your
[quoted text clipped - 13 lines]
>>
>> Seems access has this capability but I cant find it. TIA
Ken Snell [MVP] - 27 Feb 2005 19:34 GMT
To put checkbox controls on the form, open it in design view and drag
checkboxes onto the form. That is done just the same way as you did it when
the command buttons were added.

If you're wanting to know how to have VBA code do something with the
checkboxes' values, you'll need to tell me more about what your form is used
for and what is supposed to happen when a checkbox is checked.
Signature


       Ken Snell
<MS ACCESS MVP>

> We currently have buttons in forms. We click on a button & a vba program
> gets control. So what is the step/steps to get to checkbox control ... .
[quoted text clipped - 17 lines]
>>>
>>> Seems access has this capability but I cant find it. TIA
colleen medin - 27 Feb 2005 23:22 GMT
Ok thanks for the tip. I did use help & found some help.

What we are trying to do is: modify parts of a users record.
Would like to present several check boxes which will fix parts of the users
record. ie a check box to change the zip code, a check box to change the
phone number... . Then when vba gets the click it can get the info from the
operator & modify the appropriate field of the users record ... .

I tried to follow the help for a check box but when they said click the
'field list' I got no response. So was unable to drag the field. :-(.

> To put checkbox controls on the form, open it in design view and drag
> checkboxes onto the form. That is done just the same way as you did it when
[quoted text clipped - 34 lines]
> >>>
> >>> Seems access has this capability but I cant find it. TIA
Ken Snell [MVP] - 28 Feb 2005 15:56 GMT
In VBA code, you could loop through the checkboxes, and then do things based
on the value of the checkbox:

If Me.Checkbox1.Value = True Then
   ' do something because the checkbox is checked
End If
If Me.Checkbox2.Value = True Then
   ' do something because the checkbox is checked
End If
If Me.Checkbox3.Value = True Then
   ' do something because the checkbox is checked
End If
If Me.Checkbox4.Value = True Then
   ' do something because the checkbox is checked
End If

etc.

Signature

       Ken Snell
<MS ACCESS MVP>

> Ok thanks for the tip. I did use help & found some help.
>
[quoted text clipped - 55 lines]
>> >>>
>> >>> Seems access has this capability but I cant find it. TIA
colleen medin - 01 Mar 2005 04:13 GMT
Ok thanks that's a start. I assume one can execute vba code via the on click
property. What I am missing is how to make a box in a form with check boxes
in it. We already have a form with lots of  command buttons. I tried to add
a check box in that form but I seems to be missing something. All I could
get is a check box all by itself. Help indicated clicking on the check box
tool. If I drew a box on the form all I got was a check box. Help also
indicated that for a bound object I should drag the field from the field
list. The field list was grayed out :-(. I must be missing some easy steps.
TIA

> In VBA code, you could loop through the checkboxes, and then do things based
> on the value of the checkbox:
[quoted text clipped - 73 lines]
> >> >>>
> >> >>> Seems access has this capability but I cant find it. TIA
Ken Snell [MVP] - 01 Mar 2005 04:24 GMT
I'm not sure I'm fully understanding what you want here.

Do you want the checkboxes to be such that only one can be checked at a
time, and that if one is checked and you check a different one, the one that
was checked becomes unchecked? If yes, then what you want is an option group
(frame), in which you put checkboxes. There is a wizard for this; be sure
that the magic wand button is depressed, and then click on an option group
in the toolbox (square with XYZ at top) and then click on the form; the
wizard will guide you through it.

If you want each checkbox to be independent, but you want to draw a "box"
around all the checkboxes, then use the Rectangle control to make the 'box'.

Signature

       Ken Snell
<MS ACCESS MVP>

> Ok thanks that's a start. I assume one can execute vba code via the on
> click
[quoted text clipped - 97 lines]
>> >> >>>
>> >> >>> Seems access has this capability but I cant find it. TIA
colleen medin - 01 Mar 2005 19:30 GMT
Ok thanks for the info I was not aware how one starts the wizard.
I did find some code in help which does most of what i want.
However, this code must have the 'ok' button to invoke the vba code again.
What can i do to this code so that a single click in the checkbox will
invoke the vba code again? TIA

Dim I As Integer, dataprinted As Variant
With Assistant.NewBalloon
   .Heading = "Regional Sales Data"
   .Text = "Select the region(s) you want to print."
   For I = 1 To 3
       .Checkboxes(I).Text = "Region " & I
   Next
   .Button = msoButtonSetOkCancel
   If .Show = msoBalloonButtonOK Then
       dataprinted = 0
       For I = 1 To 3
           If .Checkboxes(I).Checked = True Then
               ' Code to print region data.
               dataprinted = dataprinted + 1
               MsgBox "Region " & I & " data printed."
           End If
       Next
       If dataprinted = 0 Then MsgBox "No data printed."
   End If
End With
> I'm not sure I'm fully understanding what you want here.
>
[quoted text clipped - 120 lines]
> >> >> >>>
> >> >> >>> Seems access has this capability but I cant find it. TIA
Ken Snell [MVP] - 01 Mar 2005 20:06 GMT
Put that code in the event procedure for the AfterUpdate event for the
checkbox.

Signature

       Ken Snell
<MS ACCESS MVP>

> Ok thanks for the info I was not aware how one starts the wizard.
> I did find some code in help which does most of what i want.
[quoted text clipped - 166 lines]
>> >> >> >>>
>> >> >> >>> Seems access has this capability but I cant find it. TIA
colleen medin - 02 Mar 2005 17:36 GMT
Read the help on afterupdate & find myself in over my head.
More help would be appreciated.

The way i understand it when i create a balloon with check boxes. Like the
code below.
I should also insert a line: assistant.afterupdate = "[more code]"
then when the operator checks a box in the balloon the 'more code' routine
gets controll.

Let me know. TIA
BTW you have been a great help.

> Put that code in the event procedure for the AfterUpdate event for the
> checkbox.
[quoted text clipped - 30 lines]
> >    End If
> > End With
Ken Snell [MVP] - 02 Mar 2005 18:01 GMT
I'm not sure where you are trying to use the 'afterupdate' expression that
you posted, but here is how to put code on an event such as AfterUpdate for
a checkbox control.

Open the form in design view. Click on the checkbox control. Click on the
Properties icon in the toolbar. Click on the Event tab. Go to the After
Update box, select [Event Procedure] from the dropdown list, click on the
three-dot button at far right side of the box, and select Code Window (if
asked). You'll then see a screen with three lines (second one will be blank)
[note that checkboxname will be replaced by the actual name of the checkbox
control]:

Private Sub checkboxname_AfterUpdate()

End Sub

In place of the blank line, put the code that you posted earlier:

Dim I As Integer, dataprinted As Variant
With Assistant.NewBalloon
   .Heading = "Regional Sales Data"
   .Text = "Select the region(s) you want to print."
   For I = 1 To 3
       .Checkboxes(I).Text = "Region " & I
   Next
   .Button = msoButtonSetOkCancel
   If .Show = msoBalloonButtonOK Then
       dataprinted = 0
       For I = 1 To 3
           If .Checkboxes(I).Checked = True Then
               ' Code to print region data.
               dataprinted = dataprinted + 1
               MsgBox "Region " & I & " data printed."
           End If
       Next
       If dataprinted = 0 Then MsgBox "No data printed."
   End If
End With

Save the form.

Signature

       Ken Snell
<MS ACCESS MVP>

> Read the help on afterupdate & find myself in over my head.
> More help would be appreciated.
[quoted text clipped - 43 lines]
>> >    End If
>> > End With
 
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.