Looping problem when setting RecordSource in Spit Form

N

nigelf

Hi,

I am doing a bit of late binding, and raising an event to set the
recordSource property in my forms depending on data entered in a Dialog form.
The code works fine in 'normal' forms and reports, but loops through the open
and close events when I'm trying it on a split screen.
Any help greatly appreciated,
Cheers Nigel

code in the split form is as follows:
Option Compare Database
Option Explicit
Private WithEvents cls As Form_dlgParamCollect

Private Sub cls_RequeryForm(frm As Form_dlgParamCollect)
'Do the requery stuf to fill the form data
Dim strWhere As String
Me.ShopName.ControlSource = "ShopName"
Me.ShopID_tblShop.ControlSource = "ShopID_tblShop"
strWhere = "WHERE tblShop.ShopID = " & frm.frmShopID
UpdateWhereClause "qryShopAisles", strWhere
Me.RecordSource = "qryShopAisles"
Me.SetFocus
End Sub

Private Sub Form_Open(Cancel As Integer)
If Not GetclsShoppingList Is Nothing Then
Set cls = GetclsShoppingList.ParamCollect
End If
End Sub

Private Sub form_Close()
Set cls = Nothing
End Sub
 

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

Top