Not a clue why the hell this doesn't work so any help is most appreciated!!
Using one form I allow the user to filter the records using combo boxes. Works fine, all the filtered records appear in a column. Next to the filtered records I have 3 command buttons – Print Preview, Print Report & Modify Report. Print Preview and Print work fine, the trouble comes with the modify command button.
The code I use is:
Expand|Select|Wrap|Line Numbers
- Private Sub Modify_Click()
- Dim criteria As String
- If Me.NewRecord Then
- MsgBox "Please select a record to view."
- Else
- Criteria = "[ID] = " & Me.[ID]
- DoCmd.OpenForm "Modify Main", , , criteria
- End If
- End Sub
What is causing me confusion is that if I open form “Modify Main” from “Objects -> Forms” it opens to the 1st record (as you would expect) but it works fine, allowing all information to be edited.
Any pointers are most welcome!
Cheers
Phil