David44Coder
Member
- Local time
- Tomorrow, 11:13
- Joined
- May 20, 2022
- Messages
- 110
Having a bit of trouble opening a Form to a particular record.
First tried
A field Called "Station" does exist with a record Place but that didn't work. It just opened to the first record.
So in Form Load event I put
This also opened to the first records, so I added DoCmd.GoToRecord but can't quite figure what it wants.
Have put "Me" and the Form name and various other criteria but cannot get it to work.
Online searching found the GoToRecord syntax to move to the 7th record but that fails too.
First tried
Code:
DoCmd.OpenForm "MyForm", acFormDS, "Station = '" & Form_frmTest!Place & "'"
So in Form Load event I put
Code:
Dim Place As String
Dim r As DAO.Recordset
Place = nz(Me.OpenArgs)
Set r = Me.RecordsetClone
r.FindFirst ("Station like '" & Place & "*'")
'at this pont r.NoMatch is False
DoCmd.GoToRecord acForm, Me, , 7
This also opened to the first records, so I added DoCmd.GoToRecord but can't quite figure what it wants.
Have put "Me" and the Form name and various other criteria but cannot get it to work.
Online searching found the GoToRecord syntax to move to the 7th record but that fails too.