Check my code

matthewnsarah07

Registered User.
Local time
Yesterday, 17:54
Joined
Feb 19, 2008
Messages
192
Hi

I am using the following code to open a another form but the Where criteria is not filtering correctly - all field and form names are correct and the subform where the button is, is a continuous form

Hope someone can point out what i have done wrong here

Code:
Private Sub Command21_Click()
Dim strForm As String
Select Case Me.Accept_etc
    Case Is = "Awaiting TM Approval"
        strForm = "frmeditrequest"
        DoCmd.OpenForm strForm, acNormal, , [Request Number] = [Forms]![frmmain]![frmmainsub].[Form]![Request Number]
    Case Else
        MsgBox "This request can no longer be altered", vbOKOnly
End Select
End Sub
 
Thanks for the advice

Gave this a try using the syntax for numerical values adding " & before the rest of the condition. I noticed an " appeared at the end of my condition aswell (appeared automatically) and now no results are shown at all

Any ideas?
 
What does that line look like now?
 
Code:
DoCmd.OpenForm strForm, acNormal, , [Request Number] = " & [Forms]![frmmain]![frmmainsub].[Form]![Request Number]"
 
You missed the quotes before the field name, which is why it added a set at the end. Try:

DoCmd.OpenForm strForm, acNormal, , "[Request Number] = " & [Forms]![frmmain]![frmmainsub].[Form]![Request Number]
 

Users who are viewing this thread

Back
Top Bottom