By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,091 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,091 IT Pros & Developers. It's quick & easy.

More challenges with Returning orders

P: n/a
Hi!

Background info:

I put the essential data from tblOrders, tblCustomers in the head
section on a popup form, and the data from tblOrderDetails in the
Detail section. The form is a continous form.

I made a tblReturningOrders that I use as data for the report of this.

It is all being:

DoCmd.RunSQL "DELETE * FROM tblReturningOrders"
DoCmd.RunSQL "INSERT INTO tblReturningOrders SELECT * FROM
qrySendReturn
"WHERE (((OrderNr) = Forms!frmOrders!OrderNr));"

It works fine.

Thanks to Darryll and Ed for superb help.

At the end of tblReturningOrders I put a 'Select'-field (Yes/No). Now
every time a user choose this checkbox on the form I did:

Private Sub chkReturned_Click()
Me.Refresh
End Sub

and only the selected rows will go to the report, since
tblReturningOrders is the source for the report.

Now to another question:

How can I select all checkboxes on the continous form with a
button?
Setting Me!chkReturned.Value = true
will only select the first one.

Do I need a controltype property to cycle through or..?

I also plan to make a copy of tblOrders and tblOrderDetails, in order
to copy the returned order, so that the IRS, when due time comes, will
greet us.

Is this a good procedure or bad programming?

I have a thousand other question, but I don't think You can bear it
all for the moment, so let me threat you nicely in portions :-)

Me.Name
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Geir Baardsen wrote:
How can I select all checkboxes on the continous form with a
button?
Setting Me!chkReturned.Value = true
will only select the first one.

Do I need a controltype property to cycle through or..?


I'd suggest you use an update-query for that, i.e.:

private sub chkReturned_AfterUpdate()
currentdb.execute _
"UPDATE tblXY " & _
"SET Returned=" & cstr(chkReturned) & " " & _
[Where-clause here]
me.requery
end sub

Basically, the above would require the WHERE-clause corresponding to that
of your continous form (if there is one). Also, you might have to remember
and restore the current record-position before and after issuing the
requery.
Another way would be to loop through all records, but using a query is
definitely the fastest and best approach.

Cheers,
Olaf [MVP]
--
My .02: www.Resources.IntuiDev.com
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.