Hi guys, I have a piece of code that I've haphazardly written in order to run a query on_click of a form button.
Private Sub Command153_Click()
If Forms![form name1]![form name2]!Text143 <> Null Then
DoCmd.OpenQuery "InsertGroup", acNormal, acEdit
Else
End If
End Sub
I haven't written a custom if before in VBA so I think I'm probably just getting this wrong as it is literally not doing anything (No errors or anything, I assume its just not running the query). I know that the query I'm calling in works fine as if I simply get the on_click to run the query without the if, I have no problems whatsoever. I'm also referencing the correct textbox and have tried this both with and without test data in the text box.
Any help is greatly appreciated!
Regards,
Andy.