A
Amateur
I have a customer table where I can choose, with checkboxes, the payment
method for the clients (yearly- or halfyearpayment)
I have two append queries (1) billcemeteryyear 2) billcemeteryhalfyear)
which should send the data from the choosed paymentmethod to a table called
billing, where the bill gets created.
That means if I choose the payment method “halfyear†the data from the
billcemeteryhalfyear append query should be transferred to the table
“billingâ€. If I choose the payment method “yearly†the data from the
billcemeteryyear append query should be transferred to the table “billingâ€.
So, only one of those two queries should show data which has to be
transferred to create the bill.
The queries are working correct if I run them manually one-by-one.
This process I try to run with a command button on a form using my SQL
command.
If I open the form once and choose the checkbox i.e. Yearly payment, than
run the sql command – everything works fine.
If I realized that I checked the checkbox “yearlypayment†by mistake, and it
should be “Halfyearpayment†I uncheck “yearlypayment†and check
“Halfyearpayment†– and – run the command again.
The following happens :
Either – It is transferring again the data from billcemeteryyear append
query (but the halfyearpayment checkbox is checked and the
billcemeteryhalfyear append query is showing the data from halfyearpayment,
and the billcemeteryyear append query doesn’t show any data - how can the
program append data which is not in the query)
Or – It is not transferring any rows from any query even if the
billcemeteryhalfyear append query is showing one row of data
Or – Nothing happens if I push the command button (not even error messages
or warnings)
This is my Sql:
****************************
Private Sub Command29_Click()
Dim stDocName As String
Dim strWhere As String
DoCmd.OpenQuery “billcemeteryyearâ€, acViewNormal, acEdit
DoCmd.OpenQuery “billcemeteryhalfyearâ€, acViewNormal, acEdit
strWhere = “[clientID] = “ & Me.[clientID]
DoCmd.OpenReport “billingâ€, acViewNormal, , strWhere
DoCmd.OpenQuery “billingtabledeleteâ€, acViewNormal, acEdit
End Sub
****************************
Can someone help me?
Thanks
Klaus
method for the clients (yearly- or halfyearpayment)
I have two append queries (1) billcemeteryyear 2) billcemeteryhalfyear)
which should send the data from the choosed paymentmethod to a table called
billing, where the bill gets created.
That means if I choose the payment method “halfyear†the data from the
billcemeteryhalfyear append query should be transferred to the table
“billingâ€. If I choose the payment method “yearly†the data from the
billcemeteryyear append query should be transferred to the table “billingâ€.
So, only one of those two queries should show data which has to be
transferred to create the bill.
The queries are working correct if I run them manually one-by-one.
This process I try to run with a command button on a form using my SQL
command.
If I open the form once and choose the checkbox i.e. Yearly payment, than
run the sql command – everything works fine.
If I realized that I checked the checkbox “yearlypayment†by mistake, and it
should be “Halfyearpayment†I uncheck “yearlypayment†and check
“Halfyearpayment†– and – run the command again.
The following happens :
Either – It is transferring again the data from billcemeteryyear append
query (but the halfyearpayment checkbox is checked and the
billcemeteryhalfyear append query is showing the data from halfyearpayment,
and the billcemeteryyear append query doesn’t show any data - how can the
program append data which is not in the query)
Or – It is not transferring any rows from any query even if the
billcemeteryhalfyear append query is showing one row of data
Or – Nothing happens if I push the command button (not even error messages
or warnings)
This is my Sql:
****************************
Private Sub Command29_Click()
Dim stDocName As String
Dim strWhere As String
DoCmd.OpenQuery “billcemeteryyearâ€, acViewNormal, acEdit
DoCmd.OpenQuery “billcemeteryhalfyearâ€, acViewNormal, acEdit
strWhere = “[clientID] = “ & Me.[clientID]
DoCmd.OpenReport “billingâ€, acViewNormal, , strWhere
DoCmd.OpenQuery “billingtabledeleteâ€, acViewNormal, acEdit
End Sub
****************************
Can someone help me?
Thanks
Klaus