Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: AfterUpdate event and Form Filtering

Geek News

AfterUpdate event and Form Filtering
Kirk P. 12/23/2008 6:29:00 PM
I've got this code in my AfterUpdate event of my combo box

Private Sub cboGlob_Disp_Name_AfterUpdate()

Dim strSQL As String
If IsNull(Me.cboGlob_Disp_Name) Then
' If the combo is Null, use the whole table as the RecordSource.
Me.RecordSource = "qselEQU_SEC_B"
Else
strSQL = "SELECT * FROM qselEQU_SEC_B " & _
"INNER JOIN qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
qselEQU_SEC_A.[Global Company Display Name] " & _
"WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name & ";"
Me.RecordSource = strSQL
End If
End Sub

The AfterUpdate event doesn't seem to be firing. When I click on one of the
selections, nothing happens - no error message or anything. Help?

Re: AfterUpdate event and Form Filtering
Rick Brandt <rickbrandt2[ at ]hotmail.com> 12/23/2008 6:35:45 PM
On Tue, 23 Dec 2008 10:29:00 -0800, Kirk P. wrote:

[Quoted Text]
> I've got this code in my AfterUpdate event of my combo box
>
> Private Sub cboGlob_Disp_Name_AfterUpdate()
>
> Dim strSQL As String
> If IsNull(Me.cboGlob_Disp_Name) Then
> ' If the combo is Null, use the whole table as the RecordSource.
> Me.RecordSource = "qselEQU_SEC_B"
> Else
> strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
> qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
> qselEQU_SEC_A.[Global Company Display Name] " & _
> "WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
> ";" Me.RecordSource = strSQL
> End If
> End Sub
>
> The AfterUpdate event doesn't seem to be firing. When I click on one of
> the selections, nothing happens - no error message or anything. Help?

Do you have "[Event Procedure]" entered in the After Update property box?


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Re: AfterUpdate event and Form Filtering
Kirk P. 12/23/2008 9:06:07 PM
Yes, I do have [Event Procedure] in the After Update box. I don't know if
this makes any difference, but the combo box I'm using to filter the data is
based on a select query, which is based on an Oracle pass-through query. Not
sure if that makes any difference....

"Rick Brandt" wrote:

[Quoted Text]
> On Tue, 23 Dec 2008 10:29:00 -0800, Kirk P. wrote:
>
> > I've got this code in my AfterUpdate event of my combo box
> >
> > Private Sub cboGlob_Disp_Name_AfterUpdate()
> >
> > Dim strSQL As String
> > If IsNull(Me.cboGlob_Disp_Name) Then
> > ' If the combo is Null, use the whole table as the RecordSource.
> > Me.RecordSource = "qselEQU_SEC_B"
> > Else
> > strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
> > qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
> > qselEQU_SEC_A.[Global Company Display Name] " & _
> > "WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
> > ";" Me.RecordSource = strSQL
> > End If
> > End Sub
> >
> > The AfterUpdate event doesn't seem to be firing. When I click on one of
> > the selections, nothing happens - no error message or anything. Help?
>
> Do you have "[Event Procedure]" entered in the After Update property box?
>
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
Re: AfterUpdate event and Form Filtering
Kirk P. 12/23/2008 9:37:12 PM
Yes, it does have "[Event Procedure]" entered in the After Update property box.

"Rick Brandt" wrote:

[Quoted Text]
> On Tue, 23 Dec 2008 10:29:00 -0800, Kirk P. wrote:
>
> > I've got this code in my AfterUpdate event of my combo box
> >
> > Private Sub cboGlob_Disp_Name_AfterUpdate()
> >
> > Dim strSQL As String
> > If IsNull(Me.cboGlob_Disp_Name) Then
> > ' If the combo is Null, use the whole table as the RecordSource.
> > Me.RecordSource = "qselEQU_SEC_B"
> > Else
> > strSQL = "SELECT * FROM qselEQU_SEC_B " & _ "INNER JOIN
> > qselEQU_SEC_A ON qselEQU_SEC_B.GLOBAL_COMPANY_DISPLAY_NAME =
> > qselEQU_SEC_A.[Global Company Display Name] " & _
> > "WHERE [Global Company Display Name] = " & Me.cboGlob_Disp_Name &
> > ";" Me.RecordSource = strSQL
> > End If
> > End Sub
> >
> > The AfterUpdate event doesn't seem to be firing. When I click on one of
> > the selections, nothing happens - no error message or anything. Help?
>
> Do you have "[Event Procedure]" entered in the After Update property box?
>
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net