arpeggione
Programmer
Hi all: From a ComboBox "afterupdate" event in a form, I requery a subform (in a container), based upon the ID of the record the user chooses (me.txtUserADID). This worked fine in Access 2003. The query - at the query level also works fine in 2007 (if I type in the ID) - either in the query or when asked. But...I can't get the subform to display the requeried data in 2007 or 2010. Any ideas? Code below:
Thank you!
Karen
Public Sub ComboAdUpdate()
On Error GoTo myErr
Me.txtSiteAD.SetFocus
Me.txtUserADID = Me.cboSiteAd.Column(2)
Me.txtSiteAD = Me.cboSiteAd.Column(0)
Me.txtADDescrip = Me.cboSiteAd.Column(1)
MsgBox "txtuseradid = " & Me.txtUserADID
Me![AssemblyDetailDescriptionCtnr].Form.Requery
Me.cboEditMid.RowSourceType = "Table/Query"
Me.cboEditMid.RowSource = "SELECT [MID_ID], [MID], [Assy], [Description], [UOM] FROM tblMaterial ORDER BY tblMaterial.MID;"
Me.txtEditQty.SetFocus
myExit:
Me.txtEditQty.SetFocus
Exit Sub
myErr:
If Err.Number = 3021 Or Err.Number = 3077 Then
Resume Next
Else
MsgBox Err.Number & ", " & Err.Description
GoTo myExit
End If
End Sub
Thank you!
Karen
Public Sub ComboAdUpdate()
On Error GoTo myErr
Me.txtSiteAD.SetFocus
Me.txtUserADID = Me.cboSiteAd.Column(2)
Me.txtSiteAD = Me.cboSiteAd.Column(0)
Me.txtADDescrip = Me.cboSiteAd.Column(1)
MsgBox "txtuseradid = " & Me.txtUserADID
Me![AssemblyDetailDescriptionCtnr].Form.Requery
Me.cboEditMid.RowSourceType = "Table/Query"
Me.cboEditMid.RowSource = "SELECT [MID_ID], [MID], [Assy], [Description], [UOM] FROM tblMaterial ORDER BY tblMaterial.MID;"
Me.txtEditQty.SetFocus
myExit:
Me.txtEditQty.SetFocus
Exit Sub
myErr:
If Err.Number = 3021 Or Err.Number = 3077 Then
Resume Next
Else
MsgBox Err.Number & ", " & Err.Description
GoTo myExit
End If
End Sub