Question : Access - Calling a Sub form after a "click"

I have an access form with a several "buttons" on it.
When I click on a specific button I want a sub form to open.

I have added a bit of VBA to do this but no form appears.
See the DoCmd.OPenForm code in the extract below.
Why doesn't my form pop-up?

(Excuse my bad naming conventions etc)
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
Private Sub Received_File_Click()
action_work = "Received File"
location_work = "Personal Banking Team"
MsgBox "pre formopen"
DoCmd.OpenForm Frm_Locations
Write_Transaction location_work, action_work, who_goes_there
End Sub

Answer : Access - Calling a Sub form after a "click"

change this

DoCmd.OpenForm Frm_Locations


to

DoCmd.OpenForm "Frm_Locations"
Random Solutions  
 
programming4us programming4us