Dear Sirs
I have a VB code which is executing appen-,deletequeries and is printing a
report.
To run this code I have to check upfront a checkbox – either yearlypayment
or halfyearpayment. After the code ran the checkbox is still checked. I would
like the checkbox automatically unchecking, after the VB code ran. Is this
possible with another line in the VB code and if yes, how?
This is my code:
Private Sub cmdPrintbill_Click()
Dim stDocName As String
CurrentDB.Execute "billyearlyhelpappendquery", dbFailOnError
CurrentDB.Execute "billhalfyearhelpappendquery", dbFailOnError
CurrentDB.Execute "billsappendquery", dbFailOnError
CurrentDB.Execute "openbillsappendquery", dbFailOnError
DoCmd.OpenReport "billingcemetery", acViewNormal
CurrentDB.Execute "billingtabledeletequeryquery", dbFailOnError
End Sub
Thanks
Klaus
Maurice - 15 May 2007 18:19 GMT
Well you could end your code with(before the end sub): me.checkbox=false
Where checkbox is the name of your checkbox.
Maurice
> Dear Sirs
>
[quoted text clipped - 20 lines]
> Thanks
> Klaus
Amateur - 15 May 2007 19:31 GMT
The checkboxes are on a subform how can I write the code correct.
Somehow I have to show where the textbox is 8something like):
me.[billinghalfyear].halfyearpayment = False
but that's not working.
Can you tell me how it is correct?
Thanks
Klaus
> Well you could end your code with(before the end sub): me.checkbox=false
> Where checkbox is the name of your checkbox.
[quoted text clipped - 25 lines]
> > Thanks
> > Klaus
Jackie L - 15 May 2007 19:49 GMT
Is your code running from the subform or the main form?
You may need the code to read
Forms!frmMainForm!sfrmSubform.forms!CheckBox = False
Hope this helps.
> The checkboxes are on a subform how can I write the code correct.
> Somehow I have to show where the textbox is 8something like):
[quoted text clipped - 33 lines]
> > > Thanks
> > > Klaus
Amateur - 15 May 2007 20:11 GMT
the checkboxes are on a subform and should be cleared there - but I don't
understand what you are saying.
Maybe you can specify with the details I am giving now.
My subform is called "billinghalfyear" the checkbox is called
"halfyearpayment" - How does it has to look?
Forms!frmofferandbill!sfrmbillinghalfyear.forms!halfyearpayment = False
like this it's not working, can you help?
Thanks
Klaus
> Is your code running from the subform or the main form?
> You may need the code to read
[quoted text clipped - 40 lines]
> > > > Thanks
> > > > Klaus