vista with Access 2003 crash on subform A-Z sort and double click

P

phleduc

Consider the following set-up:
Form (campaigns) with subform (customers part of a campaign), the sunform is
in table view, allows users to sort on a column.
Code in the double click event of the subform:
When you double click it should open the customers form with only the
customers for that campaign, starting with the customer you just clicked on
This has been working well on all XP and Access 2003 machines but Access
crashes every time when you do this on Vista plus Access 2003.
Any ideas why and how to fix?

Dim stDocName As String
Dim stLinkCriteria As String
Dim lngcusid As Long

stDocName = "frmOrdersByCustomer"
lngcusid = Me![cusid]

DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmOrdersbyCustomer.Form.AllowAdditions = False
Alternatively goto record and allow browsing back and forth
'make sure first that we change the recordsource to the selected
records
'Forms!frmOrdersByCustomer.Form.RecordSource = Me.RecordSource
If Forms!frmcampaigns.Form.chkActiveOnly Then
Forms!frmOrdersbyCustomer.Form.RecordSource = "Select * from
QryCampaignsCustomers where [camid] = " & Me.camID & " AND [ccuDone] =
false"
Else
Forms!frmOrdersbyCustomer.Form.RecordSource = "Select * from
QryCampaignsCustomers where [camid] = " & Me.camID
End If
Forms!frmOrdersbyCustomer.RecordsetClone.FindFirst "[CusID]=" &
lngcusid
If Forms!frmOrdersbyCustomer.Form.RecordsetClone.NoMatch Then
MsgBox "customer not found"
Else
Forms!frmOrdersbyCustomer.Form.Bookmark =
Forms!frmOrdersbyCustomer.Form.RecordsetClone.Bookmark
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top