Ask a Question related to Microsoft Access, Design and Development.
-
Chad #1
refreshing a checkbox
I posted this in a google google group and havent had any
luck as of yet. Maybe you guys can help me.
I have a list box that gets it data from a query (we can
call it listbox1)I also have a checkbox that returns
information depending on which records are selected in
Listbox1. When I click on the record in runtime,
everything runs great, but I need to be able to perform
this action in code. I am able to selct different records
in the Listbox1 using Listbox1.Selected(intIndex), but
when I do this the checkbox is not refreshed. I am
fairly new to VBA so I am not sure about what code I
should use to accomplish this. I have already tried to
use chkRecord.Requery but that doesn't work. Any help
would be greatly appreciated.
Thanks in advance,
Chad
**The only reply I have gotten from the google group is
to try chkRecord.Recalc. When I use that it says that
the object doesn't support that property or method.**
Chad Guest
-
.asr pages not refreshing?
I have a Flash cfform that has ActionScript the includes a "#include 'my_asr_page.asr'" statement. My .asr page works fine with the form, but when I... -
Refreshing Templates
Hi, I'm using Dreamweaver templates (DW8 and Cont. 3) to administer a website. The client requested two new navigation items so I added them to... -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
Refreshing, lineto's...
I have a line, that is being drawn, between two movieclips, with this code Ax = _root.A._x Ay = _root.A._y Bx = _root.B._x By = _root.B._y... -
content not refreshing
I've been doing asp for years but this one stumps me. My pages are not refreshing content. Sometimes they refresh after a minute or two. I've... -
Chad #2
Re: refreshing a checkbox
Wayne,
THanks a lot for replying to my post I have been having
many headaches trying to figure out a way to get around
this. I am not sure that running the event will help too
much but then again I am not that literate in VBA.
I have thought of 2 different ways to maybe get around
this and please let ma know if these are valid, they are
both similar.
1. Is there a way to autmate pressing the next record
button of a record selector. If I was able to do that
then both the next record in the list box will be
selected and the Record checkbox will be updated.
2. Right now, as you know, I am able to go through each
record for the list box by using
ListBox1.Selected(intIndex). Is there an equivalant to
this for a check box, so even though I have to do them
seperatedly in code I can have the records change in both
listbox and the check box.
Thanks again,
Chadvalue you want under the>-----Original Message-----
>You will probably need to tell the check box to have thedoesn't fire the events that actually>conditions set up by your code.
>
>Example:
>Me.chkMyCheckbox = False
>
>You are correct, updating through code frequently(it depends on how you have>clicking on the item will fire. Another possible optionshave set the items in the listbox>things set up) is to tell the event code to run once youlistbox. If not and this is what you>through code.
>
>Example:
>listbox1_Click
>
>This assumes that the code is on the same form as thenews:0a6501c34a24$8eba06a0$a501280a@phx.gbl...>want to do, let me know.
>
>--
>Wayne Morgan
>Microsoft Access MVP
>
>
>"Chad" <ChadLucy@msn.com> wrote in messageany>> I posted this in a google google group and havent hadcan>> luck as of yet. Maybe you guys can help me.
>>
>> I have a list box that gets it data from a query (werecords>> call it listbox1)I also have a checkbox that returns
>> information depending on which records are selected in
>> Listbox1. When I click on the record in runtime,
>> everything runs great, but I need to be able to perform
>> this action in code. I am able to selct different>>> in the Listbox1 using Listbox1.Selected(intIndex), but
>> when I do this the checkbox is not refreshed. I am
>> fairly new to VBA so I am not sure about what code I
>> should use to accomplish this. I have already tried to
>> use chkRecord.Requery but that doesn't work. Any help
>> would be greatly appreciated.
>>
>> Thanks in advance,
>> Chad
>>
>> **The only reply I have gotten from the google group is
>> to try chkRecord.Recalc. When I use that it says that
>> the object doesn't support that property or method.**
>
>.
>Chad Guest
-
Wayne Morgan #3
Re: refreshing a checkbox
A check box doesn't have an index number because it doesn't hold multiple values at one
time, it is either True or False. If it is set for Triple State then add Null to the
possible list. Simply setting the value of the checkbox is how you would set it. Now, if
you name your checkboxes sequentially, you can use a loop to go through them.
Example:
chkCheckbox1, chkCheckbox2
For i = 1 to 2
Me.Controls("chkCheckbox" & i) = False
Next i
Yes, you can move from one record to another in code.
Example:
If Not Me.Recordset.EOF Then
Me.Recordset.MoveNext
End If
EOF stands for End Of File, you don't want to move to the next record if you're at the
end.
--
Wayne Morgan
Microsoft Access MVP
"Chad" <ChadLucy@msn.com> wrote in message news:04e301c34a7b$57700da0$a601280a@phx.gbl...> Wayne,
> THanks a lot for replying to my post I have been having
> many headaches trying to figure out a way to get around
> this. I am not sure that running the event will help too
> much but then again I am not that literate in VBA.
> I have thought of 2 different ways to maybe get around
> this and please let ma know if these are valid, they are
> both similar.
>
> 1. Is there a way to autmate pressing the next record
> button of a record selector. If I was able to do that
> then both the next record in the list box will be
> selected and the Record checkbox will be updated.
>
> 2. Right now, as you know, I am able to go through each
> record for the list box by using
> ListBox1.Selected(intIndex). Is there an equivalant to
> this for a check box, so even though I have to do them
> seperatedly in code I can have the records change in both
> listbox and the check box.
>
> Thanks again,
> Chad> value you want under the> >-----Original Message-----
> >You will probably need to tell the check box to have the> doesn't fire the events that actually> >conditions set up by your code.
> >
> >Example:
> >Me.chkMyCheckbox = False
> >
> >You are correct, updating through code frequently> (it depends on how you have> >clicking on the item will fire. Another possible options> have set the items in the listbox> >things set up) is to tell the event code to run once you> listbox. If not and this is what you> >through code.
> >
> >Example:
> >listbox1_Click
> >
> >This assumes that the code is on the same form as the> news:0a6501c34a24$8eba06a0$a501280a@phx.gbl...> >want to do, let me know.
> >
> >--
> >Wayne Morgan
> >Microsoft Access MVP
> >
> >
> >"Chad" <ChadLucy@msn.com> wrote in message> any> >> I posted this in a google google group and havent had> can> >> luck as of yet. Maybe you guys can help me.
> >>
> >> I have a list box that gets it data from a query (we> records> >> call it listbox1)I also have a checkbox that returns
> >> information depending on which records are selected in
> >> Listbox1. When I click on the record in runtime,
> >> everything runs great, but I need to be able to perform
> >> this action in code. I am able to selct different> >> >> in the Listbox1 using Listbox1.Selected(intIndex), but
> >> when I do this the checkbox is not refreshed. I am
> >> fairly new to VBA so I am not sure about what code I
> >> should use to accomplish this. I have already tried to
> >> use chkRecord.Requery but that doesn't work. Any help
> >> would be greatly appreciated.
> >>
> >> Thanks in advance,
> >> Chad
> >>
> >> **The only reply I have gotten from the google group is
> >> to try chkRecord.Recalc. When I use that it says that
> >> the object doesn't support that property or method.**
> >
> >.
> >
Wayne Morgan Guest
-
Chad #4
Re: refreshing a checkbox
Wayne,
THanks for your help. Moving to the next record does
exactly what I needed.
Chaddoesn't hold multiple values at one>-----Original Message-----
>A check box doesn't have an index number because itTriple State then add Null to the>time, it is either True or False. If it is set foris how you would set it. Now, if>possible list. Simply setting the value of the checkboxloop to go through them.>you name your checkboxes sequentially, you can use athe next record if you're at the>
>Example:
>chkCheckbox1, chkCheckbox2
>
>For i = 1 to 2
> Me.Controls("chkCheckbox" & i) = False
>Next i
>
>
>Yes, you can move from one record to another in code.
>
>Example:
>If Not Me.Recordset.EOF Then
> Me.Recordset.MoveNext
>End If
>
>EOF stands for End Of File, you don't want to move tonews:04e301c34a7b$57700da0$a601280a@phx.gbl...>end.
>
>--
>Wayne Morgan
>Microsoft Access MVP
>
>
>"Chad" <ChadLucy@msn.com> wrote in messagehaving>> Wayne,
>> THanks a lot for replying to my post I have beentoo>> many headaches trying to figure out a way to get around
>> this. I am not sure that running the event will helpare>> much but then again I am not that literate in VBA.
>> I have thought of 2 different ways to maybe get around
>> this and please let ma know if these are valid, theyeach>> both similar.
>>
>> 1. Is there a way to autmate pressing the next record
>> button of a record selector. If I was able to do that
>> then both the next record in the list box will be
>> selected and the Record checkbox will be updated.
>>
>> 2. Right now, as you know, I am able to go throughboth>> record for the list box by using
>> ListBox1.Selected(intIndex). Is there an equivalant to
>> this for a check box, so even though I have to do them
>> seperatedly in code I can have the records change inthe>> listbox and the check box.
>>
>> Thanks again,
>> Chad>> >-----Original Message-----
>> >You will probably need to tell the check box to haveoptions>> value you want under the>> doesn't fire the events that actually>> >conditions set up by your code.
>> >
>> >Example:
>> >Me.chkMyCheckbox = False
>> >
>> >You are correct, updating through code frequently>> >clicking on the item will fire. Another possibleyou>> (it depends on how you have>> >things set up) is to tell the event code to run oncehad>> have set the items in the listbox>> listbox. If not and this is what you>> >through code.
>> >
>> >Example:
>> >listbox1_Click
>> >
>> >This assumes that the code is on the same form as the>> news:0a6501c34a24$8eba06a0$a501280a@phx.gbl...>> >want to do, let me know.
>> >
>> >--
>> >Wayne Morgan
>> >Microsoft Access MVP
>> >
>> >
>> >"Chad" <ChadLucy@msn.com> wrote in message>> >> I posted this in a google google group and haventin>> any>> can>> >> luck as of yet. Maybe you guys can help me.
>> >>
>> >> I have a list box that gets it data from a query (we>> >> call it listbox1)I also have a checkbox that returns
>> >> information depending on which records are selectedperform>> >> Listbox1. When I click on the record in runtime,
>> >> everything runs great, but I need to be able tobut>> records>> >> this action in code. I am able to selct different>> >> in the Listbox1 using Listbox1.Selected(intIndex),tried to>> >> when I do this the checkbox is not refreshed. I am
>> >> fairly new to VBA so I am not sure about what code I
>> >> should use to accomplish this. I have alreadyhelp>> >> use chkRecord.Requery but that doesn't work. Anygroup is>> >> would be greatly appreciated.
>> >>
>> >> Thanks in advance,
>> >> Chad
>> >>
>> >> **The only reply I have gotten from the googlethat>> >> to try chkRecord.Recalc. When I use that it saysmethod.**>> >> the object doesn't support that property or>>> >
>> >
>> >.
>> >
>
>.
>Chad Guest
-
Chad #5
Re: refreshing a checkbox
Wayne,
I promise this is my last question for you. Thank you
for your patience. In moving to the next record with the
code Me.Recordset.MoveNext, how would I switch Me to the
name of the form that I am using. I tried
Forms!frmResults!subfrmSCResults.Recordsset.MoveNe xt but
it ways that the object doesnt support that property or
method. The reason I am asking is because I was thinking
about putting the code in a seperate module and calling
on it when I needed it.
THanks again.
Chaddoesn't hold multiple values at one>-----Original Message-----
>A check box doesn't have an index number because itTriple State then add Null to the>time, it is either True or False. If it is set foris how you would set it. Now, if>possible list. Simply setting the value of the checkboxloop to go through them.>you name your checkboxes sequentially, you can use athe next record if you're at the>
>Example:
>chkCheckbox1, chkCheckbox2
>
>For i = 1 to 2
> Me.Controls("chkCheckbox" & i) = False
>Next i
>
>
>Yes, you can move from one record to another in code.
>
>Example:
>If Not Me.Recordset.EOF Then
> Me.Recordset.MoveNext
>End If
>
>EOF stands for End Of File, you don't want to move tonews:04e301c34a7b$57700da0$a601280a@phx.gbl...>end.
>
>--
>Wayne Morgan
>Microsoft Access MVP
>
>
>"Chad" <ChadLucy@msn.com> wrote in messagehaving>> Wayne,
>> THanks a lot for replying to my post I have beentoo>> many headaches trying to figure out a way to get around
>> this. I am not sure that running the event will helpare>> much but then again I am not that literate in VBA.
>> I have thought of 2 different ways to maybe get around
>> this and please let ma know if these are valid, theyeach>> both similar.
>>
>> 1. Is there a way to autmate pressing the next record
>> button of a record selector. If I was able to do that
>> then both the next record in the list box will be
>> selected and the Record checkbox will be updated.
>>
>> 2. Right now, as you know, I am able to go throughboth>> record for the list box by using
>> ListBox1.Selected(intIndex). Is there an equivalant to
>> this for a check box, so even though I have to do them
>> seperatedly in code I can have the records change inthe>> listbox and the check box.
>>
>> Thanks again,
>> Chad>> >-----Original Message-----
>> >You will probably need to tell the check box to haveoptions>> value you want under the>> doesn't fire the events that actually>> >conditions set up by your code.
>> >
>> >Example:
>> >Me.chkMyCheckbox = False
>> >
>> >You are correct, updating through code frequently>> >clicking on the item will fire. Another possibleyou>> (it depends on how you have>> >things set up) is to tell the event code to run oncehad>> have set the items in the listbox>> listbox. If not and this is what you>> >through code.
>> >
>> >Example:
>> >listbox1_Click
>> >
>> >This assumes that the code is on the same form as the>> news:0a6501c34a24$8eba06a0$a501280a@phx.gbl...>> >want to do, let me know.
>> >
>> >--
>> >Wayne Morgan
>> >Microsoft Access MVP
>> >
>> >
>> >"Chad" <ChadLucy@msn.com> wrote in message>> >> I posted this in a google google group and haventin>> any>> can>> >> luck as of yet. Maybe you guys can help me.
>> >>
>> >> I have a list box that gets it data from a query (we>> >> call it listbox1)I also have a checkbox that returns
>> >> information depending on which records are selectedperform>> >> Listbox1. When I click on the record in runtime,
>> >> everything runs great, but I need to be able tobut>> records>> >> this action in code. I am able to selct different>> >> in the Listbox1 using Listbox1.Selected(intIndex),tried to>> >> when I do this the checkbox is not refreshed. I am
>> >> fairly new to VBA so I am not sure about what code I
>> >> should use to accomplish this. I have alreadyhelp>> >> use chkRecord.Requery but that doesn't work. Anygroup is>> >> would be greatly appreciated.
>> >>
>> >> Thanks in advance,
>> >> Chad
>> >>
>> >> **The only reply I have gotten from the googlethat>> >> to try chkRecord.Recalc. When I use that it saysmethod.**>> >> the object doesn't support that property or>>> >
>> >
>> >.
>> >
>
>.
>Chad Guest
-
Wayne Morgan #6
Re: refreshing a checkbox
Me is shorthand for the form that the code is running on. To refer to another form you
need to use, as you indicated, Forms!FormName. To refer to a subform on a form, you need
to refer to the control on the main form that holds the subform.
Example:
Forms!frmResults!NameOfSubformControl.Form.Records et.MoveNext
(you also had a typo, only one "s" in recordset)
If the form running the code is frmResults you could shorten the above:
Me!NameOfSubformControl.Form.Recordset.MoveNext
To get the name of the subform control, open the main form in design mode. Open the
Properties sheet if it isn't already. Click on the subform ONE time. The Properties sheet
should show the name of the subform control. If you click twice, you'll be in the subform
and the Properties sheet will show the name of the form, not the control holding it.
--
Wayne Morgan
Microsoft Access MVP
"Chad" <ChadLucy@msn.com> wrote in message news:0c9201c34ade$436e8ee0$a401280a@phx.gbl...> Wayne,
> I promise this is my last question for you. Thank you
> for your patience. In moving to the next record with the
> code Me.Recordset.MoveNext, how would I switch Me to the
> name of the form that I am using. I tried
> Forms!frmResults!subfrmSCResults.Recordsset.MoveNe xt but
> it ways that the object doesnt support that property or
> method. The reason I am asking is because I was thinking
> about putting the code in a seperate module and calling
> on it when I needed it.
Wayne Morgan Guest



Reply With Quote

