Trbl with Filter

Crash1hd

Registered CyberGeek
Local time
Today, 02:47
Joined
Jan 11, 2004
Messages
143
The following code is used to open a form with specific criteria problem is that once the criteria is met and the form is open if I want to goto the next or previous record of that employee it wont let me how do I remove the second part of the filter once its used on open

Code:
DoCmd.OpenForm "Inbound", , , "[Inbound.tblInitials] = " & """" & Me.tblInitials & """ AND [Inbound.tblRRound] = " & tblRRound & ""

so once the form is open I need to remove [Inbound.tblRRound] = " & tblRRound & "" of the filter???
 
Crash,

Boy do I hate these ...

Code:
DoCmd.OpenForm "Inbound", , , "[Inbound.tblInitials] = """ & Me.tblInitials & """ AND [Inbound.tblRRound] = " & tblRRound

TblRRound is numeric.

Wayne
 
Thanks for the clean up however it doesnt solve the original problem I still cant go to previous record or next record because of the tblrround being filtered to 1 record Is there a way to stop the 2nd half of the filter I have tried show all records but that wont filter the name
 
Ok so I made a desision and decided that it will open the report instead of the form solves the need to change filter problem however my syntax is incorrect and I need help

I have tried this
Code:
        DoCmd.OpenReport "Inbound_Report", acPreview, , "[Inbound.tblInitials] = """ & Me.tblInitials & """ AND [Forms]![Inbound]![tblInbound_ID] = " & tblInbound_ID

and this

Code:
        DoCmd.OpenReport "Inbound_Report", acPreview, , "[Inbound.tblInitials] = """ & Me.tblInitials & """ AND [[Forms]![Inbound]![tblInbound_ID]] = " & tblInbound_ID

and neither work I cant change it from [forms]![Inbound]![tblInbound_ID] cause that is what is in the Query and I need that for the button in the form to work

the button

Code:
Private Sub Print_Preview_Click() 'Button
On Error GoTo Err_Print_Preview_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    
    stDocName = "Inbound_Report"
    
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenReport stDocName, acPreview

Exit_Print_Preview_Click:
    Exit Sub

Err_Print_Preview_Click:
    MsgBox Err.Description
    Resume Exit_Print_Preview_Click
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom