Quantcast
Viewing all articles
Browse latest Browse all 13329

Unable to open Form using Where Clase

Good Evening All

I am having an issue opening a Subform from VBA within Access 2007

I have two forms to keep it simple "Intruder Alarm Reports" and "Continue Report"

Within "Intruder Alarm Report" there is a combi box which includes the Officer name from a lookup named Attended By.

Within the "Continue Report" Form I have 3 Combi Boxes "Report" "Officer" and "Date"

What I want to do is using the continue report through a button open the form which matches the Critia selected in the "Continue Report" Form.

I have created the following basic code

Private Sub Command4_Click()
Dim report As String

report = Me.Type_of_Incident
DoCmd.OpenForm report, , , "Attended By= " & Officer.Value

End Sub

This does not work I recieve a Run time error 3075 missing operator but removing the where conditioning does open the correct form

Have searched and tried serveral variations some just open the main form but do not open the form with the Officer name.

Have checked the properties of the of the intruder alarm form and all naming conventions are correct.

Also after this will require the Continue report form to sort on date which I also cannot get to work

Any help will be much appricatiated

Thank you

Viewing all articles
Browse latest Browse all 13329

Trending Articles